/*!
- * OOjs UI v0.24.0
+ * OOjs UI v0.24.2
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2017 OOjs UI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2017-10-17T23:18:51Z
+ * Date: 2017-11-07T22:52:40Z
*/
( function ( OO ) {
* Handle menu toggle events.
*
* @private
- * @param {boolean} isVisible Menu toggle event
+ * @param {boolean} isVisible Open state of the menu
*/
OO.ui.DropdownWidget.prototype.onMenuToggle = function ( isVisible ) {
this.$element.toggleClass( 'oo-ui-dropdownWidget-open', isVisible );
!this.isDisabled() &&
(
e.which === OO.ui.Keys.ENTER ||
+ (
+ e.which === OO.ui.Keys.SPACE &&
+ // Avoid conflicts with type-to-search, see SelectWidget#onKeyPress.
+ // Space only closes the menu is the user is not typing to search.
+ this.menu.keyPressBuffer === ''
+ ) ||
(
!this.menu.isVisible() &&
(
- e.which === OO.ui.Keys.SPACE ||
e.which === OO.ui.Keys.UP ||
e.which === OO.ui.Keys.DOWN
)
this.menu.connect( this, {
choose: 'onMenuChoose',
add: 'onMenuItemsChange',
- remove: 'onMenuItemsChange'
+ remove: 'onMenuItemsChange',
+ toggle: 'onMenuToggle'
} );
// Initialization
this.$element.toggleClass( 'oo-ui-comboBoxInputWidget-empty', this.menu.isEmpty() );
};
+/**
+ * Handle menu toggle events.
+ *
+ * @private
+ * @param {boolean} isVisible Open state of the menu
+ */
+OO.ui.ComboBoxInputWidget.prototype.onMenuToggle = function ( isVisible ) {
+ this.$element.toggleClass( 'oo-ui-comboBoxInputWidget-open', isVisible );
+};
+
/**
* @inheritdoc
*/