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

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(-)

Approvals:
  Jforrester: 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 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: merged
Gerrit-Change-Id: I4ca445f2c43438c36ece23245660b63f2a48b722
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to