mskocik / svelecte

Flexible autocomplete/select component written in Svelte,
https://svelecte.vercel.app
MIT License
469 stars 42 forks source link

Feature request - hide dropdown arrow / entire item list #222

Closed foochris closed 7 months ago

foochris commented 7 months ago

Thank you @mskocik for your excellent work.

Is it possible to hide the display the list of all the terms (and the dropdown arrow) upon click and only show matches to a search query upon entering the text?

I didn't see any option in list of properties to accomplish this.

I have a requirement that upon focus or click of the component, the display of all items is not allowed. Matching items can only be displayed upon entering of a search query.

mskocik commented 7 months ago

This setting is not supported and I don't plan to implement. But you can work around it by hooking listener to inner <input> element and apply CSS conditionally. Something like in this REPL.

foochris commented 7 months ago

Thanks for your REPL suggestion as I was able to fufill the requirements. 💯