Close or not open select on clear.

84 views
Skip to first unread message

mar...@gmail.com

unread,
Mar 27, 2017, 2:39:24 PM3/27/17
to select2
Hi...

I tryed to prevent select2 opening when clear button is pressed.
How to implement it?

mar...@gmail.com

unread,
Apr 5, 2017, 10:05:56 AM4/5/17
to select2, mar...@gmail.com
Thanks for help.

j(".select").on("select2:select", function () { //register event for each click
var select = this;
j(".select2-selection__clear").mousedown(function (e) {
j(select).val(null).trigger("change");
e.stopPropagation();
})
});

Reply all
Reply to author
Forward
0 new messages