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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Copy link
Collaborator

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

This comment has been minimized.

Copy link
Author

sympmarc commented Feb 13, 2019

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

@estruyf

This comment has been minimized.

Copy link
Collaborator

estruyf commented Feb 13, 2019

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

@sympmarc

This comment has been minimized.

Copy link
Author

sympmarc commented Feb 14, 2019

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

@estruyf estruyf added this to the 1.12.0 milestone Feb 22, 2019

@estruyf estruyf closed this in ee93225 Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.