CapsuleMultiSelectWidget should take care of it by itself, but its
logic is foiled by how we canonicalize the data.
Bug: T122219
Change-Id: I2bdc3681dfde3080067ea12e5a036824d154a72f
} );
};
+ /**
+ * @inheritdoc
+ */
+ CSP.getItemFromData = function ( data ) {
+ // This is a bit of a hack... We have to canonicalize the data in the same way that
+ // #createItemWidget and CategoryCapsuleItemWidget will do, otherwise we won't find duplicates.
+ data = mw.Title.newFromText( data, NS_CATEGORY ).getMainText();
+ return OO.ui.mixin.GroupElement.prototype.getItemFromData.call( this, data );
+ };
+
/**
* Validates the values in `this.searchType`.
*