Skip to content

Commit

Permalink
Prevent highlighting the first parameter when clicking to remove
Browse files Browse the repository at this point in the history
Tabbing into the parameter select list should highlight the first
parameter, but focusing a checkbox by clicking it to uncheck should
not trigger this highlighting.

Copied from the superclass method.

Bug: T312014
Change-Id: Ia1fd450bad4861eb2815ca21eae69ee31e40ac08
  • Loading branch information
adamwight committed Jul 4, 2022
1 parent c2e1112 commit 6c16f93
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ ve.ui.MWTransclusionOutlineParameterSelectWidget.prototype.onCheckboxChange = fu
/**
* @inheritDoc OO.ui.SelectWidget
*/
ve.ui.MWTransclusionOutlineParameterSelectWidget.prototype.onFocus = function () {
if ( !this.findHighlightedItem() ) {
ve.ui.MWTransclusionOutlineParameterSelectWidget.prototype.onFocus = function ( event ) {
if ( event.target === this.$element[ 0 ] &&
!this.findHighlightedItem()
) {
// When tabbing into the selection list, highlight the first parameter.
this.highlightItem( this.items[ 0 ] );
}
// Don't call the parent. It makes assumptions that conflict with how we use selections.
Expand Down

0 comments on commit 6c16f93

Please sign in to comment.