DLynch has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/279961

Change subject: MWLinkAnnotationInspector: select entire link when switching 
tabs
......................................................................

MWLinkAnnotationInspector: select entire link when switching tabs

Bug: T129650
Change-Id: I4ca445f2c43438c36ece23245660b63f2a48b722
---
M modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/61/279961/1

diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js 
b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
index 02a88ad..69dbbd8 100644
--- a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
+++ b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js
@@ -289,8 +289,12 @@
        }
 
        this.annotationInput.getTextInputWidget().setValue( text ).focus();
-       // Firefox moves the cursor to the beginning
-       this.annotationInput.getTextInputWidget().$input[ 0 
].setSelectionRange( end, end );
+       // Select entire link when switching, for ease of replacing entire 
contents.
+       // Most common case:
+       // 1. Inspector opened, internal-link shown with the selected-word 
prefilled
+       // 2. User clicks external link tab (unnecessary, because we'd 
auto-switch, but the user doesn't know that)
+       // 3. User pastes a link, intending to replace the existing prefilled 
link
+       this.annotationInput.getTextInputWidget().$input[ 0 
].setSelectionRange( 0, end );
 
        this.updateActions();
 };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ca445f2c43438c36ece23245660b63f2a48b722
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>

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

Reply via email to