fabianlindfors / multi.js

A user-friendly replacement for select boxes with the multiple attribute enabled
https://fabianlindfors.se/multijs
MIT License
953 stars 76 forks source link

redraw() is needed if external js disables options after the multi initialization #32

Open 2x2p opened 5 years ago

2x2p commented 5 years ago

If JavaScript has disabled for example Blueberry after the multi has already been Initialized. Blueberry will not be shown as a disabled option until the user clicks e.g. Coconut. The other JavaScript should be able to ask for a redraw of the entire element.

Or how can I trigger a change() after initialization?

2x2p commented 5 years ago

I do understand triggering a change can be done through JQuery after reading issue #15. But can it be done when JQuery is not present? For example when multi is also listening for element.focus() or element.blur()?

I am asking because if the select tag has the onChange set in its HTML any function called onChange is again calling for a refresh as suggested in #15 $( element ).trigger( 'change' ); this will cause an infinite loop.

fabianlindfors commented 4 years ago

I'm sorry about the very late reply! Do you still need help with this issue? If so, could you explain a bit further what you're trying to achieve?