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

ListItemPicker selected values are not getting cleared or reset #659

Closed
PavithraaPandiyan opened this issue Sep 9, 2020 · 3 comments
Closed
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Milestone

Comments

@PavithraaPandiyan
Copy link

Hello All,
I am using ListItemPicker control inside a panel in my react based spfx project solution. I have a reset button in the panel, on click of reset button, the selected values in the ListItemPicker should be cleared. I kept the selected values in a state variable and tried to clear the state on click of reset button. This is clearing the value of the state variable (checked in console), but i am able to see the values in the ListItemPicker HTML text box. Please suggest me possible ways to clear the selected values immediately in the ListItemPicker on click of reset button.

Sample Code:
<ListItemPicker
listId={GUID ID IS PASSED}
columnInternalName='Title'
keyColumnInternalName='Id'
itemLimit={10}
onSelectedItem={this.onTagSelectedItem.bind(this)}
context={this.props.context}
defaultSelectedItems={this.state.tagSelectedValues}
suggestionsHeaderText = "Suggested Tags"
/>

this.state.tagSelectedValues --> I am saving the selected values in "tagSelectedValues" state variable and on click of reset button, i trying to set state as empty to "tagSelectedValues" ( this.setState({tagSelectedValues:[]}); ). But this is not clearing the values in the ListItemPicker HTML Text box immediately.

Thanks!

@ghost
Copy link

ghost commented Sep 9, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Sep 9, 2020
@injaan
Copy link

injaan commented Dec 2, 2020

Same problem here, controller not refreshed to new value

@AJIXuMuK AJIXuMuK mentioned this issue Dec 2, 2020
AJIXuMuK added a commit that referenced this issue Dec 2, 2020
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Dec 2, 2020

Hi @PavithraaPandiyan,
Thank you for reporting the issue. It has been fixed and will be included in the next release.
In a meanwhile you can test the functionality in beta version.

@AJIXuMuK AJIXuMuK added status:fixed-next-drop Issue will be fixed in upcoming release. type:bug and removed Needs: Triage 🔍 labels Dec 2, 2020
@AJIXuMuK AJIXuMuK added this to the 2.2.0 milestone Dec 2, 2020
@estruyf estruyf mentioned this issue Dec 3, 2020
@AJIXuMuK AJIXuMuK closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Projects
None yet
Development

No branches or pull requests

3 participants