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

Ability to reset the TaxonomyPicker (Remove all selected Terms) #367

Closed
M-SGFx opened this issue Sep 11, 2019 · 3 comments
Closed

Ability to reset the TaxonomyPicker (Remove all selected Terms) #367

M-SGFx opened this issue Sep 11, 2019 · 3 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:bug
Milestone

Comments

@M-SGFx
Copy link

M-SGFx commented Sep 11, 2019

Category

Question

Version

1.14.0

Expected / Desired Behavior / Question

I need to remove the selected Term(s) from multiple TaxonomyPicker controls when the "Clear" button is clicked. Seems like there is no Clear function available? Please suggest how can I achieve this?

Basically the webpart has multiple TaxonomyPicker controls used for filtering the data in a grid. I need a functionality where users can click a button and all the filters needs to be removed.

Thanks!

@ghost
Copy link

ghost commented Sep 11, 2019

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 11, 2019
@AJIXuMuK
Copy link
Collaborator

Hi @M-SGFx
Have you tried to implement custom Clear button and change initialValues property to be []?
Like

private clear() {
this.setState( { pickerInitialValues: [] });
}

public render() {
// ...
<TaxonomyPicker
  initialValues={this.state.pickerInitialValue} />
}

But keep in mind that in that case the picker becomes "controlled" component and you will need to handle onChange event as well to update selected terms collection.

AJIXuMuK added a commit that referenced this issue Oct 13, 2020
@AJIXuMuK AJIXuMuK added status:fixed-next-drop Issue will be fixed in upcoming release. type:bug and removed Needs: Triage 🔍 labels Oct 13, 2020
@AJIXuMuK AJIXuMuK added this to the 2.1.0 milestone Oct 13, 2020
@AJIXuMuK
Copy link
Collaborator

It seems like it was broken.

The fix has been implemented and will be included in the next release.
In a meanwhile you can test the functionality in beta version

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

2 participants