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

Reset People Picker in single selection mode leaves search input in disabled state #2683

Closed
Jimmy-Tsang opened this issue Aug 25, 2023 · 3 comments · Fixed by #2792
Closed
Assignees
Labels
bug Something isn't working good first issue Good for newcomers State: In Review
Milestone

Comments

@Jimmy-Tsang
Copy link

I configure people picker in single selection mode, but I have a need to manually clear the people-picker's selected person through JavaScript on modal open. So I reset selectedPeople property with an empty array. By doing this, it clears the selected person, but the search input textbox remains in disabled state. User will not be able to enter new search term.

Steps to reproduce the behavior:

  1. Configure a people picker field in a modal form
  2. Trigger to open the modal, then select a user from the people picker
  3. Close the modal
  4. Reopen the modal
  5. Notice the people picker input textbox is disabled

image

image

image

@Jimmy-Tsang Jimmy-Tsang added bug Something isn't working Needs: Triage 🔍 labels Aug 25, 2023
@sebastienlevert
Copy link
Contributor

Can you share more around how you create the modal? We really never put the control in disabled state so I'm curious why this happens...

@gavinbarron
Copy link
Member

@sebastienlevert the input will become disabled when a single selection is made if the component has selection-mode="single" as it doesn't make sense to allow users to try and search to add another selection once one has been added.

@sebastienlevert
Copy link
Contributor

Absolutely agree, I understand now. It's by setting it to [] that it fails as it doesn't set its state back to enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers State: In Review
Projects
Archived in project
4 participants