Open kshaner opened 7 years ago
With the latest pull request #93 this issue seems resolved
the events when I select an deselect:
change: value x // selected the value x change: null // deselected the value (cleared it) deselect: value x
Hi in the documentation it says that in order to allow unselect you need clearable=true and allowDeselect=true With this configuration everything works fine for me:
var selectr: any = document.getElementById(this.id);
var options = {
allowDeselect: true,
clearable: true,
};
const selectorSelect = new Selectr(selectr, options)
There is a bug when using a clearable select and listening to the selectr.change event. It appears that select.deselect fires before selectr.change and the selectr.change argument provides the previous value and not an empty value. This is a problem for my use case because I'm using selectr to control external actions.
Sample: