The filter options' labels are set as "label for" the checkbox
which means that by default they "give" the focus away to the
checkbox when clicked. However, we don't want that behavior so
that we can continue arrow movement through the filter option
items rather than the DOM elements. Also, the checkbox prevents
defaults on click as well as it is.
Change-Id: I9758b0dacd8cd647ec5e3e623edc66e1d7f7420a
label: $label,
align: 'inline'
} );
-
// Event
this.model.connect( this, { update: 'onModelUpdate' } );
this.model.getGroupModel().connect( this, { update: 'onGroupModelUpdate' } );
+ // HACK: Prevent defaults on 'click' for the label so it
+ // doesn't steal the focus away from the input. This means
+ // we can continue arrow-movement after we click the label
+ // and is consistent with the checkbox *itself* also preventing
+ // defaults on 'click' as well.
+ layout.$label.on( 'click', false );
this.$element
.addClass( 'mw-rcfilters-ui-filterMenuOptionWidget' )
*/
mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onMenuChoose = function ( item ) {
this.controller.toggleFilterSelect( item.model.getName() );
+
+ this.focus();
};
/**