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

Multiselect defaultValue doesn't refresh when props value changes #1135

Open
Grumpier opened this issue Oct 27, 2022 · 1 comment
Open

Multiselect defaultValue doesn't refresh when props value changes #1135

Grumpier opened this issue Oct 27, 2022 · 1 comment

Comments

@Grumpier
Copy link

Hi. I'm trying to use this widget to display tag selections made by the user inside another component rather than within Multiselect itself. The idea is that from within Multiselect, the user can see the tags currently inside the filter array and remove them, but selection of tags is done through the other component. I'm looking to achieve something like this:

image

The code is
<Multiselect defaultValue={props.filter} />
However, the Multiselect component does not seem to be re-rendering when props.filter is changed.

If instead I try
<Multiselect data={props.filter} />
the data does re-render.

Is there any workaround to force the component to re-render the default values when the hooked array changes?

Thanks for any help you can offer!

@coder89
Copy link

coder89 commented Apr 3, 2023

some properties (like event handlers) are also not refreshing when they are changed for Combobox

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

No branches or pull requests

2 participants