selectize.js icon indicating copy to clipboard operation
selectize.js copied to clipboard

Keep dropdown open

Open samselikoff opened this issue 11 years ago • 3 comments

I'd writing a component that wraps selectize, and I want to use my own controls to programmatically open and close the dropdown.

I'd like to prevent the default behavior where a click to the triggers the dropdown. Is this possible via selectize's api? I found lock but this didn't seem to do it.

Thanks for the great plugin!

samselikoff avatar Jun 09 '15 20:06 samselikoff

HI @samselikoff, If you dont want to do your own fork from selectize.js, you need a hacked workaround, you may execute this javascript, after the selectize is already in DOM:

   $( ".selectize-dropdown" ).show();

This will not be affected by the focusout events.

*If you have more than one "selectize-dropdown" you should just do .show() in this element that you want to open.

btw, when you want to close it just use:

   $( ".selectize-dropdown" ).hide();

BR

Marius

edelsbrunner avatar Jun 10 '15 15:06 edelsbrunner

Hi @edelsbrunner, I'm trying to do the same thing. The solution you provided didn't work - blur events still caused the dropdown to close

Do you have an alternate solution?

EricHanLiu avatar Jul 24 '19 12:07 EricHanLiu

Yes. I was looking for the same enhancement.

mvivekc avatar Oct 26 '19 07:10 mvivekc