Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/215937
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/37/215937/1
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: newchange
Gerrit-Change-Id: I785863e9a3bd3c0d548bee13ae2810eccc739a8f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits