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

Can't clear PeoplePicker value(s) #234

Closed
sympmarc opened this issue Feb 8, 2019 · 4 comments
Closed

Can't clear PeoplePicker value(s) #234

sympmarc opened this issue Feb 8, 2019 · 4 comments
Milestone

Comments

@sympmarc
Copy link

sympmarc commented Feb 8, 2019

Category

[ ] Enhancement
[X] Bug
[ ] Question

Version

Please specify what version of the library you are using: [1.11.0 ]

Expected / Desired Behavior / Question

I'd like to be able to clear the value(s) selected in the PeoplePicker programmatically. In my specific case, I'm using the People Picker to select a person to use for filtering a listof items.

Observed Behavior

When I set defaultSelectedUsers to [] (an empty array), the previously selected value remains.

Steps to Reproduce

Here's an example of my code for defaultSelectedUsers:

defaultSelectedUsers={(this.state.filters.ShipmentRequestor && this.state.filters.ShipmentRequestor.length) ? [this.state.filters.ShipmentRequestor.email] : []}

This will either yield an array of email addresses or an empty array.

@estruyf
Copy link
Member

estruyf commented Feb 11, 2019

@sympmarc included the fix from @tsekityam. Can you verify if it fixed it on your end by installing the latest beta version?

@sympmarc
Copy link
Author

Sorry I haven't replied. I'm heading home from SPTechCon today and will test tomorrow.

@estruyf
Copy link
Member

estruyf commented Feb 13, 2019

No problem @sympmarc, have fun at SPTechCon and say hi to @sebastienlevert.

@sympmarc
Copy link
Author

Works for me! Thanks for the update, @tsekityam.

@estruyf estruyf added this to the 1.12.0 milestone Feb 22, 2019
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 a pull request may close this issue.

2 participants