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

People picker selection mode single still selects multiple users #65

Closed
Jcardif opened this issue Jan 11, 2021 · 6 comments
Closed

People picker selection mode single still selects multiple users #65

Jcardif opened this issue Jan 11, 2021 · 6 comments

Comments

@Jcardif
Copy link

Jcardif commented Jan 11, 2021

Selection Mode not working as expected

I have set the picker on xaml as follows:

                    <controls:PeoplePicker
                        PlaceholderText="Select Engineer on Duty*"
                        RelativePanel.Below="RootCauseTextBox"
                        Margin="{StaticResource MediumTopMargin}"
                        Width="200" Height="35"
                        Padding="{StaticResource MediumTopMargin}"
                        SelectionMode="Single" 
                        Name="FieldEngineerPicker"/>

However, it allows for multiple selection of people when I run it.

Expected behavior

Only one user should be selected from the dropdown list

Screenshots

Environment

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] Insider Build (build number:20279.fe_release.201209-1322 )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: 16.8) 
- [ ] 2019 Preview (version: )

@Jcardif Jcardif added the bug 🐛 Something isn't working label Jan 11, 2021
@ghost ghost added the needs triage 🔍 label Jan 11, 2021
@ghost
Copy link

ghost commented Jan 11, 2021

Hello Jcardif, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@michael-hawker
Copy link
Member

Thanks for the bug report @Jcardif, this is an underlying issue with the base TokenizingTextBox control.

The TokenizingTextBox was built inherently with multiple selection in it's core purpose, otherwise a drop-down using the PersonView within the template is a better UX choice? Could you describe your user scenario in a bit more detail? Maybe we need a different version of this control somewhere to help encapsulate that better?

The SelectionMode property is just coming from ListViewBase and we never intended to hook it up into this control, though I'm not sure if we can hide it... I've filed a bug in our main repo for tracking that discussion there: CommunityToolkit/WindowsCommunityToolkit#3672

@Jcardif
Copy link
Author

Jcardif commented Jan 18, 2021

my application is used to select a user from Graph and assign a specific app role and the requirements are that only one user should be assigned at a time, the current picker selects multiple users unfortunately. Or is there another control for this purpose?

@michael-hawker
Copy link
Member

@Jcardif we don't have a control that provides that functionality out of the box. We only have the multi-select scenario setup through TokenizingTextBox. You can look at the source we have here to get the call you need from the Graph and just use that to populate a normal ComboBox control.

@shweaver-MSFT
Copy link
Member

shweaver-MSFT commented Aug 4, 2021

Support for restricting the TokenizingTextBox to one token at a time is in PR in the WCT repo currently: CommunityToolkit/WindowsCommunityToolkit#4163

Once that gets figured out, the PeoplePicker control can then take advantage of that feature to resolve/support this scenario! 🚢

@shweaver-MSFT shweaver-MSFT added this to the 7.1.0 milestone Aug 18, 2021
@shweaver-MSFT
Copy link
Member

The feature has been added to the TokenizingTextBox in Windows Community Toolkit 🚀 The PeoplePicker will have the new MaximumTokens property for limiting the number of allowable tokens in the upcoming 7.1.0 release.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants