pnp / pnp/sp-dev-fx-controls-react
PeoplePicker: Inconsistent results
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 433
- Forks
- 418
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 19
Description
Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your
needs please complete the below template to ensure we have the details to help. Thanks!
Please check out the documentation to see if your question is already addressed there. This will help us ensure our documentation is up to date.
Category
[ ] Enhancement
[ X] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 1.14.0 ]
Expected / Desired Behavior / Question
I would like to search for users using the ensureUser flag in People Picker. I would like for the results of this search to be consistent whether I am searching for internal or guest users (provided organizational policy settings allow this), and whether I am searching as an internal or guest user.
Observed Behavior
-
For a search without the EnsureUser flag the results are as follows (provided that the user is found):
With an internal account: The id property contains the full user principal name ("i:0#.f|.....)". The secondaryText property contains a user email address.
With a guest account: The id field is undefined. However, the secondaryText field property contains the full user principal name. -
The EnsureUser flag behaves differently based on whether the caller is an internal or guest user. If the current user context is that of an internal user, the "id" result field will contain a number. If the caller is a guest user, the "id" result field will contain undefined.
-
The EnsureUser flag will find and return an id number of a guest user that has already been added to the hidden user list, but will seemingly not find and add guest users who have not been added to the hidden user list (no results in the People Picker).
Steps to Reproduce
Add the following code to your webpart and build it, running it in an internal and guest user context side by side:
<PeoplePicker
showHiddenInUI={true}
ensureUser={true}
personSelectionLimit={20}
context={this.props.contextW}
selectedItems={
people => {
this.setUsers(people.map(user => user.id));
}
}
/>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the PeoplePicker control and reproduce the supplied example using ensureUser in both internal and guest user contexts. Compare the id and secondaryText results for internal users, guest users, and guests absent from the hidden user list. Done means the results are consistent where organizational policy permits, with the observed cases covered by verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100