mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Emit select null on selected item removal
Issues: * Selected item is removed, but no select even was emitted Changes: ve.ui.SelectWidget.js * On remove, emit select null when removing a selected item * On clear, emit select null always Change-Id: I1a94b0f8a841611b20e09f6c02f37fb9589e85c3
This commit is contained in:
parent
4fb94d9586
commit
cdc342362c
|
@ -377,6 +377,9 @@ ve.ui.SelectWidget.prototype.removeItems = function ( items ) {
|
|||
// Remove existing item
|
||||
delete this.hashes[hash];
|
||||
}
|
||||
if ( item.isSelected() ) {
|
||||
this.selectItem( null );
|
||||
}
|
||||
}
|
||||
ve.ui.GroupElement.prototype.removeItems.call( this, items );
|
||||
|
||||
|
@ -399,6 +402,7 @@ ve.ui.SelectWidget.prototype.clearItems = function () {
|
|||
// Clear all items
|
||||
this.hashes = {};
|
||||
ve.ui.GroupElement.prototype.clearItems.call( this );
|
||||
this.selectItem( null );
|
||||
|
||||
this.emit( 'remove', items );
|
||||
|
||||
|
|
Loading…
Reference in a new issue