fix(updateSelectizeInput): Clear current value before update if selected
and sever = TRUE
#3967
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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