jenkins-bot has submitted this change and it was merged.

Change subject: Move cursor to end when changing link mode
......................................................................


Move cursor to end when changing link mode

Allows you to keep typing after 'http://' in Firefox

Bug: T98895
Change-Id: I785863e9a3bd3c0d548bee13ae2810eccc739a8f
---
M modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Trevor Parscal: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js 
b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
index 273e5f0..379052c 100644
--- a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
+++ b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
@@ -155,6 +155,7 @@
  */
 ve.ui.MWLinkAnnotationInspector.prototype.onLinkTypeSelectSelect = function () 
{
        var text = this.annotationInput.text.getValue(),
+               end = text.length,
                isExternal = this.isExternal(),
                inputHasProtocol = 
ve.init.platform.getExternalLinkUrlProtocolsRegExp().test( text );
 
@@ -169,6 +170,8 @@
        }
 
        this.annotationInput.text.setValue( text ).focus();
+       // Firefox moves the cursor to the beginning
+       this.annotationInput.text.$input[0].setSelectionRange( end, end );
 
        if ( !isExternal ) {
                this.annotationInput.text.populateLookupMenu();

-- 
To view, visit https://gerrit.wikimedia.org/r/215937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I785863e9a3bd3c0d548bee13ae2810eccc739a8f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Trevor Parscal <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to