trevoreyre / autocomplete

Accessible autocomplete component for vanilla JavaScript and Vue.
https://autocomplete.trevoreyre.com
MIT License
434 stars 75 forks source link

Autocomplete dropdown closes on click outside of browser window #126

Open mmoore99 opened 3 years ago

mmoore99 commented 3 years ago

The Autocomplete dropdown closes on any mouse click outside of the autocomplete component, even on a click outside of browser window. Is this the expected behavior? Is there any way to keep the dropdown list open when clicking outside of the component?

trevoreyre commented 3 years ago

I think that's expected behavior. I'm just using a listener on document click to close the dropdown, so I can't really control when the browser fires that event.

msawired commented 3 years ago

That would be very helpful have an attribute to turn this behavior off. Particularly during development, while working on styling the dropdown list...

BenjaminBeck commented 1 year ago

a workaround:

const autocomplete = new Autocomplete('#autocomplete', options);
autocomplete.core.hideResults = function() {};