-
Notifications
You must be signed in to change notification settings - Fork 291
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
People picker component "Single" selection mode not working, still lets you select 2 items #2919
Comments
This issue has been assigned to you, @sebastienlevert. You are listed as the author for the document associated with this issue. If this is not correct, please take the following actions.
|
When using your setup with your attributes, I can't get it to work as I'm getting an error from Graph : {
"error": {
"code": "Request_UnsupportedQuery",
"message": "Filter operator 'NotEqualsMatch' is not supported.",
"innerError": {
"date": "2023-12-18T15:06:55",
"request-id": "d2f4fe2c-5616-489d-8b00-ce4475a6e969",
"client-request-id": "d2f4fe2c-5616-489d-8b00-ce4475a6e969"
}
}
} If you remove the You can see it succeed without the If you are willing to send us a PR that would fix this issue, please feel free! https://aka.ms/mgt Adding @gavinbarron @musale @Mnickii for awareness. |
The idea is to not let the user select its own account, the user's own account must be excluded from the picker and thus, the reason to put an 'ne' filter. Is there any other way to do that without triggering this behavior? I think the 'selected items' collection can be manipulated by a 'selected change' event |
I absolutely understand the use case, which is a very value one! Now, the use of Now, onto your question and finding a workaround, I wasn't able to find anything that would exclude a user (as excluding means using negative keywords on the API) and wouldn't work from the API directly. You could remove the current user when selected, but for our use case, this would be too late as the item would already be selected (and visible in the selection area). Adding @gavinbarron for thoughts on this case. To me, this would be a good for 2 specific changes to the people picker component:
|
What version of MGT is being used? When testing a simple case single selection is limiting the number of selection available: Even adding all the other filter options I still can only select one user with the current version of MGT. Regarding the enhancements to allow negative filter queries, I feel like adding a extra attribute for excluding the current user is a nice convenient short cut. As to adding the consistency level and count parameters, I think that we might want to be a bit smart about those and only add them if there is an |
Interesting... Can you reproduce in the stackblitz link I shared? https://stackblitz.com/edit/mgt-8925?file=src%2FApp.tsx I tried to give a first go to supporting the advanced queries using the |
done it, and was able to fix the issue, so far I've learned the following 1: The issue happens only on mtg-react v2, once I've migrated to v3 the issue went away |
Another interesting find
|
Thanks for sharing your findings. I'm curious on the userFilters usage with the 'ne' operator. You are saying you can run exclude yourself from the results? We faced the issue today and created a fix to bring this feature for all our code paths using the users endpoint. Were you using this branch? |
I was using mtg-react 2.11.2 and using the following query
mtg-react produces a query like this and sends it to graph
Still works without issues in V3+ |
The query (once searching) works, but I assume there is an HTTP 400 on the initial load where it doesn't load anybody from the |
I'm using graph toolkit for react, and have a people picker that can show up to 5 people on the search, but accept only one selection.
An attribute seems to exist to regulate if the selection can be multiple or single.
The issue is that even if I set the attribute to "single" the picker still allows me to select 2 elements
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: