You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Can't add items to a (multi) select after updating inputs (in order) #2058
This codepen demonstrates the issue. In there, clicking the button (which updates the inputs with new options) breaks the 1st input's click-to-select behavior. Here's a screencast of the issue:
It's worth noting this isn't a problem with the latest release (v0.15.2), but it is a problem with the current HEAD of the master branch (e3f2e0b), which is the version the codepen is above using.
Also, the codepen console.log()s some information related to (what appears to be) the source of the issue (eventNS). Here's my understanding of it.
Everytime .selectize() is called, it increases a global count, and uses that count for eventNS:
As a result, if you initialize say 2 selectize inputs, the count will be at 2. If you then .destroy() the 1st widget (taking the count back to 1), then re-initialize it (bumping the count back to 2), then the the 1st widget winds up with the same eventNS as the 2nd widget.
It is a bit surprising to me that this issue has been around for nearly 7 years (and doesn't seem to be an issue for this particular behavior in v0.15.2), but I've been able to confirm, at least, that using a truly unique ID for eventNS will fix this particular problem (PR incoming)
Activity
Close selectize#2058: guarantee a unique event namespace
github-actions commentedon Feb 18, 2024
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days