Merge "RCFilters UI: Prevent label from stealing focus on click"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 18 Apr 2017 00:26:47 +0000 (00:26 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 18 Apr 2017 00:26:47 +0000 (00:26 +0000)
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuOptionWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js

index b46c069..bda537f 100644 (file)
                        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' )
index 7de2a79..8e26271 100644 (file)
         */
        mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onMenuChoose = function ( item ) {
                this.controller.toggleFilterSelect( item.model.getName() );
+
+               this.focus();
        };
 
        /**