-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(updateSelectizeInput): Clear current value before update if selected
and sever = TRUE
#3967
Conversation
…cted` and `server = TRUE` Fixes #3966
Just noting that selectize/selectize.js@5b15d3b However, the docs didn't get updated to reflect this 😞 https://selectize.dev/docs/API/selectize#clearoptionssilent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch and fix, thanks!
When a user calls
updateSelectizeInput()
withserver = TRUE
and they provide both newchoices
(required byserver = TRUE
) and a newselected
value, the current value of the select input may not be part ofchoices
. When the old value isn't inchoices
, those options will remain in the select options after the options are updated.This PR updates the client-side JS for a
server = TRUE
update to clear the current select input value whenselected
is provided, to avoid the persistence of the old values in the select options.When
selected
is not provided, we'll still run into the previous behavior, but I don't know if there's anything we can do about that since the client doesn't have complete information about the set ofchoices
.Fixes #3966