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

Pickers: Specify maximum number of items to select #1304

Closed
jquintozamora opened this issue Mar 18, 2017 · 7 comments · Fixed by #2553
Closed

Pickers: Specify maximum number of items to select #1304

jquintozamora opened this issue Mar 18, 2017 · 7 comments · Fixed by #2553

Comments

@jquintozamora
Copy link

I´d like to suggest a new functionality on Tag Picker to allow handle both scenarios multiple selection and single selection, ideally configurable by a prop. By now (as I know) it only supports multiple tag selection.

Thanks!

@mdahamiwal
Copy link
Contributor

Better to have a prop to limit selected picker items, similar to #652

@WesselKuipers
Copy link

You can kind of achieve this by disabling the underlying AutoFill component:
http://codepen.io/WesselKuipers/pen/ryYKod

This does however disable the option to remove selected items via the backspace button.

@jquintozamora
Copy link
Author

Hi @mdahamiwal , Thanks for you answer. That could be good solution as well.
Currently I am using other react picker control (https://github.com/JedWatson/react-select) in my solutions.
But I would l like to replace by the office-ui-fabric-react one. One of the main features I miss is single selection, and other is the prop "isLoading" which internally loads spinner in the control meanwhile our react application is loading items async.

@cwdata
Copy link

cwdata commented Apr 3, 2017

@dzearing
This should be considered a feature request for all picker controls. I'm using the people picker and missing a single selection property there as well and I think this is the case for all controls of that type.

@mikewheaton mikewheaton changed the title New request. Allow single selection mode on Tag Picker Pickers: Specify maximum number of items to select Jun 1, 2017
@ohritz
Copy link
Contributor

ohritz commented Aug 15, 2017

Is there any thoughts/decisions about implementing this? I couldn't make out if it was on roadmap, and if its not, do we have to wait till after v1? I wouldn't mind taking a crack at it.
I'm building a taxonomypicker for SharePoint, where the concept of single / multi is crucial.

I imagine a maxItems: number; prop on the basepicker, and conditionally render the autofill input. which I think would still allow removing a selected tag, and thereby rerendering the autofill after amount of items is below the threshold?

@jquintozamora
Copy link
Author

Hi @ohritz ,
I worked on something similar months ago, just in case it could be useful to you: https://github.com/jquintozamora/react-taxonomypicker

@ohritz
Copy link
Contributor

ohritz commented Aug 16, 2017

Hi @jquintozamora, I've seen that, thanks :). I was actually going to use it, but then we realized we need the tree view picker like the SharePoint oob control as part of the component aswell. So I started building my own. Haven't gotten so far as to implement the tree view yet.

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants