fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Picker with an icon

Open ParadimeWeb opened this issue 6 years ago • 8 comments

Describe the feature that you would like added

The ability to add an icon to the picker components. Just like the TextField, we could have the iconProps to set an icon on the right side of the field.

What component or utility would this be added to

BasePicker

Have you discussed this feature with our team, and if so, who

Additional context/screenshots

ParadimeWeb avatar Jan 21 '20 15:01 ParadimeWeb

Hi @ParadimeWeb, I think this is a fair feature request and we might want to take it into account when upgrading our Picker components, however, I don't know if we would currently put any effort into this.

@joschect what are your thoughts here?

khmakoto avatar Jan 21 '20 21:01 khmakoto

@ParadimeWeb and @khmakoto I'm not sure that we should add an icon. There are a lot of different positions that the icon could go and it's going to end up being fairly distinct depending on who is using it. For a more customized experience I would suggest using the floating picker since you can have complete control over the input. Here's an example of it being used here

joschect avatar Jan 22 '20 20:01 joschect

Hi, using the floating picker puts a lot of work in managing the selections. You are suggesting I reproduce all the logic for showing the persona in the SearchBox, being able to remove them, select multiple. That is way to much work.

The best would be to add an iconProps to the BasePicker and have it exactly how the TextField component displays the icon.

ParadimeWeb avatar Jan 23 '20 21:01 ParadimeWeb

@ParadimeWeb your concern is real but we also have to take into account how much logic we should put into our library. @joschect any more thoughts on this?

khmakoto avatar Jan 23 '20 22:01 khmakoto

@khmakoto I have a few more thoughts. @ParadimeWeb I understand that it can be a bit of work to implement the selection behavior. A simpler alternative could be to do something like this where you override the border. You'll need to do just a little work to make sure that focus goes to the picker when the icon is clicked, but that's not bad.

My concerns with adding the icon are this: we cannot account for all designs of where the icon should go and how it should act. If the icon really just needs to go to the right of the picker, then the codepen I provided a good place to start with it. You could even use your own styling function if you want. If the icon needs to do more complicated things, then the picker shouldn't own that. A possibility for the future would be to allow the input to be slotable/provide a custom render function. For right now though, the input is pretty tightly coupled with the component as a whole and it will take some effort and time to implement.

joschect avatar Jan 23 '20 23:01 joschect

I guess I'll leave the control without an icon. I don't like yours alternatives.

ParadimeWeb avatar Jan 24 '20 16:01 ParadimeWeb

Alright @ParadimeWeb, I'll be resolving this as "Resolution: By Design" then. I'm sorry we were unable to help you more with this but there is a balance to how much technical debt we are responsible as the platform vs people as developers using the platform and this would be tilting the balance a little too much to our side.

khmakoto avatar Jan 24 '20 19:01 khmakoto

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your contributions to Fabric React!

msft-github-bot avatar Jan 28 '20 20:01 msft-github-bot