Skip to content
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

Update selectInput's binding to use selectize.js' getValue() method when relevant #3926

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Oct 26, 2023

Closes #3925

@cpsievert cpsievert requested a review from gadenbuie October 26, 2023 22:03
@cpsievert cpsievert force-pushed the selectize-get-value-bugfix branch from 5b0a589 to 134d2a0 Compare October 26, 2023 22:06
Comment on lines +64 to +71
getValue(el: SelectHTMLElement): any {
if (!isSelectize(el)) {
return $(el).val();
} else {
const selectize = this._selectize(el);

return selectize?.getValue();
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, this is essentially same logic as .setValue() (which is why I've written it this way)

@cpsievert cpsievert merged commit 77bc4e9 into main Oct 26, 2023
11 checks passed
@cpsievert cpsievert deleted the selectize-get-value-bugfix branch October 26, 2023 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

selectizeInput()'s input value can be incorrect after updateSelectizeInput()
1 participant