Important tweaks for mw.widgets.CategorySelector, which will rise to
prominence soon when we deploy mw.Upload.BookletLayout in VisualEditor.
Bug: T114945
Bug: T115010
Change-Id: I4236a7c64469faa7476bcab9bd0a0f8497101fe2
+/*
+ * Local backports:
+ *
+ * - aadaa8a187d36ded603eebbdff47efe133908f6c
+ * CapsuleMultiSelectWidget: Set 'background-color' rather than 'background'
+ * Required for mw.widgets.CategorySelector's pending state to display.
+ */
+
/*!
* OOjs UI v0.12.11
* https://www.mediawiki.org/wiki/OOjs_UI
width: 100%;
}
.oo-ui-capsuleMultiSelectWidget-handle {
- background: #ffffff;
+ background-color: #ffffff;
cursor: text;
min-height: 2.4em;
margin-right: 0.5em;
+/*
+ * Local backports:
+ *
+ * - 9aba218a882ff45b07410a3ce9d5cdfd8e567e26
+ * CapsuleMultiSelectWidget: When 'allowArbitrary' is true, don't require 'Enter' to confirm
+ * Required for more intuitive behavior of mw.widgets.CategorySelector.
+ */
+
/*!
* OOjs UI v0.12.11
* https://www.mediawiki.org/wiki/OOjs_UI
* @param {jQuery.Event} event
*/
OO.ui.CapsuleMultiSelectWidget.prototype.onInputBlur = function () {
+ if ( this.allowArbitrary && this.$input.val().trim() !== '' ) {
+ this.addItemsFromData( [ this.$input.val() ] );
+ }
this.clearInput();
};