mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-10 01:26:34 +02:00
Add feature of passing the label through the event of add/remove item
This commit is contained in:
parent
4f61ac5e7a
commit
34e8a430e1
|
@ -1915,12 +1915,14 @@ class Choices {
|
|||
triggerEvent(this.passedElement, 'addItem', {
|
||||
id,
|
||||
value: passedValue,
|
||||
label: passedLabel,
|
||||
groupValue: group.value,
|
||||
});
|
||||
} else {
|
||||
triggerEvent(this.passedElement, 'addItem', {
|
||||
id,
|
||||
value: passedValue,
|
||||
label: passedLabel,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1942,6 +1944,7 @@ class Choices {
|
|||
|
||||
const id = item.id;
|
||||
const value = item.value;
|
||||
const label = item.label;
|
||||
const choiceId = item.choiceId;
|
||||
const groupId = item.groupId;
|
||||
const group = groupId >= 0 ? this.store.getGroupById(groupId) : null;
|
||||
|
@ -1952,12 +1955,14 @@ class Choices {
|
|||
triggerEvent(this.passedElement, 'removeItem', {
|
||||
id,
|
||||
value,
|
||||
label,
|
||||
groupValue: group.value,
|
||||
});
|
||||
} else {
|
||||
triggerEvent(this.passedElement, 'removeItem', {
|
||||
id,
|
||||
value,
|
||||
label,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue