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

[BUG] Using defaultSelectedUserIds and disableSuggestions people-picker component does not render the default selected users #3201

Closed
eduardpaul opened this issue Jun 6, 2024 · 2 comments · Fixed by #3279
Assignees
Labels
bug Something isn't working Component: people-picker
Milestone

Comments

@eduardpaul
Copy link

Describe the bug

If both parameters are used (defaultSelectedUserIds and disableSuggestions) on the initial load, the component does not show the default selected users. If you try to add a new one, all the default are rendered fine.

We think that the return in the following code, should be removed to solve this issue or the conditional statement moved below the rendering logic:
https://github.com/microsoftgraph/microsoft-graph-toolkit/blob/43ebacf3304bbe2bbdd537ea04dab227d4d52103/packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts#L945C1-L945C18

To Reproduce
Steps to reproduce the behavior: add people picker with defaultSelectedUserIds and disableSuggestions.

Expected behavior
On initial load, default selected users should be shown. After that, disable suggestions.

Environment (please complete the following information):
N/A

  • OS: Windows
  • Browser: all
  • Framework: react
  • Context: SharePoint
  • Version: 2.4.1
  • Provider: SharePoint

Additional context
Add any other context about the problem here.

@eduardpaul eduardpaul added bug Something isn't working Needs: Triage 🔍 labels Jun 6, 2024
@musale
Copy link
Contributor

musale commented Jun 10, 2024

@eduardpaul thank you for raising this issue. The idea behind disableSuggestions was to show no people suggestions when you click inside the people-picker input #3048. Then, you can start typing and the suggestions come in. In the shown lines, the return is used to stop an unnecessary graph call below those lines. Using both defaultSelectedUserIds means we can add logic that sets the user ids to the people variable in that block and still maintain the intention not to make an unnecessary call. Is this something you would like to help contribute?

@eduardpaul
Copy link
Author

Thanks a lot @musale ! Did not find time to try to do this by myself 😅😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Component: people-picker
Projects
Archived in project
3 participants