mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
MWLinkAnnotationInspector: select entire link when switching tabs
Bug: T129650 Change-Id: I4ca445f2c43438c36ece23245660b63f2a48b722
This commit is contained in:
parent
f239e17a1e
commit
d33f5969ad
|
@ -289,8 +289,12 @@ ve.ui.MWLinkAnnotationInspector.prototype.onLinkTypeIndexSet = function () {
|
|||
}
|
||||
|
||||
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();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue