shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.72k stars 989 forks source link

Allow read-access to the current open-state #1180

Open MatthiasMargot opened 4 years ago

MatthiasMargot commented 4 years ago

I'm using a custom caret through the caret slot and I would like to have it point down when the dropdown is closed & point up when it is open, however the only thing available for the caret's slot-scope is toggle (Function – toggles the dropdown.).

I can achieve this by hooking into @close & @open and synchronising my own isOpen state with the one from inside the dropdown, however that is rather cumbersome and creates duplicate state too.

Either another slot-scope value isOpen or even the option to control isOpen entirely from outside like mentioned in #781 would be nice.

An update:open emission would do the job as well, API design preferences I suppose. :)

Thoughts?

ChrisPlease commented 4 years ago

Second this for a11y. The latest version is v2.1.6 which provides no accessibility. Having access to isOpen would help ease some custom a11y.