Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/170781

Change subject: Recompute ComboBox selection when adding/removing items
......................................................................

Recompute ComboBox selection when adding/removing items

So you don't need a dummy call to onInputChange() to get
this to happen.

Change-Id: Idcbf38c5329cb63f06f5da0a83b1503b5db6ac13
---
M src/widgets/ComboBoxWidget.js
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/81/170781/1

diff --git a/src/widgets/ComboBoxWidget.js b/src/widgets/ComboBoxWidget.js
index a064187..d021535 100644
--- a/src/widgets/ComboBoxWidget.js
+++ b/src/widgets/ComboBoxWidget.js
@@ -105,6 +105,8 @@
  * Handle menu item change events.
  */
 OO.ui.ComboBoxWidget.prototype.onMenuItemsChange = function () {
+       var match = this.menu.getItemFromData( this.input.getValue() );
+       this.menu.selectItem( match );
        this.$element.toggleClass( 'oo-ui-comboBoxWidget-empty', 
this.menu.isEmpty() );
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/170781
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idcbf38c5329cb63f06f5da0a83b1503b5db6ac13
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to