mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-22 07:26:39 +02:00
Include customProperties in removeItem
This commit is contained in:
parent
d116f95c54
commit
684d9a8355
|
@ -1871,25 +1871,15 @@ class Choices {
|
|||
return this;
|
||||
}
|
||||
|
||||
const { id, value, label, choiceId, groupId } = item;
|
||||
const { id, choiceId, groupId } = item;
|
||||
const group = groupId >= 0 ? this._store.getGroupById(groupId) : null;
|
||||
|
||||
this._store.dispatch(removeItem(id, choiceId));
|
||||
|
||||
if (group && group.value) {
|
||||
this.passedElement.triggerEvent(EVENTS.removeItem, {
|
||||
id,
|
||||
value,
|
||||
label,
|
||||
groupValue: group.value,
|
||||
});
|
||||
} else {
|
||||
this.passedElement.triggerEvent(EVENTS.removeItem, {
|
||||
id,
|
||||
value,
|
||||
label,
|
||||
});
|
||||
}
|
||||
this.passedElement.triggerEvent(EVENTS.removeItem, {
|
||||
...item,
|
||||
groupValue: group && group.value ? group.value : undefined,
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue