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

Enable data and value to be updated in same callback #412

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

AnnMarieW
Copy link
Collaborator

@AnnMarieW AnnMarieW commented Nov 13, 2024

Closes #411

In 0.14.7, there was a regression where it was not possible to update both the value and the data in the same callback in Select and MultiSelect

This issue occurred because there are two calls to setSelected, and in PR #383, the order in which these calls were made changed. I considered combining them into a single useDidUpdate function, but that approach would have led to excessive calls to this function for clearing invalid selected values when data is updated in a callback.

Todo

  • tests
  • changelog

@AnnMarieW AnnMarieW marked this pull request as draft November 13, 2024 23:32
@AnnMarieW AnnMarieW marked this pull request as ready for review November 14, 2024 00:11
@AnnMarieW AnnMarieW requested review from snehilvj and alexcjohnson and removed request for snehilvj November 14, 2024 00:11
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

💃 This looks good to me. If you wanted to be extra cautious, you could add a counter to the callbacks in the tests (like in the dash test cbsc001 for example, to verify that the two useDidUpdate calls don't result in two callback calls. But I'm confident that's not going to be an issue so feel free to ignore this suggestion 😁

@AnnMarieW AnnMarieW merged commit 91855e2 into snehilvj:master Nov 14, 2024
1 check passed
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.

Can't update dmc.Select 'data' and 'value' inside the same callback
2 participants