closeAfterSelect is not working with create: true.
$('#select-gear').selectize({
plugins: ['remove_button'],
create: true,
closeAfterSelect: true
});
+1
+1
What's actually being observed is how the remove_button plugin works in the selectize demo. After deleting an item (removing), selectize pops back open.
This didn't make any sense to us either, so the (hackish) solution we came up with (shout out to @marcamos) was to trap item_remove, set the opacity to 0 immediately, then use a setTimeout to bring the opacity back after all selectize events were done firing:
selectize.on("item_remove", function() {
$(".selectize-dropdown").css("opacity", "0");
setTimeout(function() {
selectize.close();
selectize.blur();
$(".selectize-dropdown").css("opacity", "1");
}, 100);
});
There are other ways to do this, using the onDelete callback, etc. Anyway, sharing in case it helps someone else!
closing stale issues older than one year.
If this issue was closed in error please message the maintainers.
All issues must include a proper title, description, and examples.
Most helpful comment
What's actually being observed is how the remove_button plugin works in the selectize demo. After deleting an item (removing), selectize pops back open.
This didn't make any sense to us either, so the (hackish) solution we came up with (shout out to @marcamos) was to trap
item_remove, set the opacity to 0 immediately, then use a setTimeout to bring the opacity back after all selectize events were done firing:There are other ways to do this, using the
onDeletecallback, etc. Anyway, sharing in case it helps someone else!