bootstrap-typeahead for add multiple items to a list.
https://github.com/ericgio/react-bootstrap-typeahead
I need to pick the value, when I remove an item from the list. onChange event of the AsyncTypeahead handling the event when removing and adding items to the list.
When an item removed, selected data updating with the existing values in the list.
Eg: I have 3 items in the list, I am removing an item, Then the selected list containing existing items. (2 items)
In my project I want to get that removed item, at the time of removing.
Is there any functionality for pick that removed value in "onChange" event.
I had the same problem, and I get it sorted in this way:
Compare your current selected items with the selected items that you had before onchange
.
eg:
const removedItem = this.state.alradySelectedItems.filter(value => !selected.includes(value));