Closed nathipg closed 3 years ago
If anyone needs this in the future, I have done like this:
select.on('chosen:showing_dropdown', function (e, cfg) {
if(cfg.chosen.search_field.val() == '') {
cfg.chosen.results_hide();
}
cfg.chosen.search_field.off('keyup.chosen.checkshow');
cfg.chosen.search_field.on('keyup.chosen.checkshow', (event) => {
if(cfg.chosen.search_field.val() == '') {
cfg.chosen.results_hide();
} else if(!cfg.chosen.results_showing) {
cfg.chosen.results_show();
}
});
});
Hello!
I want to change chosen to only show results when user type, not when user click on the container. For that, I though about overwrite container_mousedown to work as I need. Is is possible? I see chosen is returned as a function, so I couldn't see an obvious way to do it.