Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

No reset the selected items after changing the property 'data'? #25

Open
winglight opened this issue Jul 24, 2020 · 1 comment
Open

Comments

@winglight
Copy link

winglight commented Jul 24, 2020

I supposed that it should be reset since the whole data had been changed.

Here's what I did:

  1. click one tag within data array A
  2. navigate / refresh the current page and replace the tagselect component with another data array B
  3. when I tried to click one tag, it shows the message: Max reached. That seems the last selected status hadn't be reset.

I'm not sure if I should set itemsSelected to [], but this property haven't a setter method. So my problem is how to reset the component selected items after changing the property 'data'?

Any hint will be appreciated.

@marvinhlc
Copy link

Hi winglight, try this:
Download de proyect and edit TagSelect.js
add this method:

//agregado por Marvin
resetSelected = () => {
let value = {}
this.setState({ value })
}
//

this work for my.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants