fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

People Picker: long people card overflows in narrow people picker

Open ipip2005 opened this issue 9 years ago • 7 comments

Bug Report

  • Package version(s): latest
  • Browser and OS versions: any

Describe the issue:

In some scenarios, people resolved from people picker will have a long name. Sometimes the people picker can be narrow (small width). Then the people card will overflow the people picker container which looks bad.

Actual behavior:

The people card overflows outside the people picker container.

Expected behavior:

The people card is totally inside people picker, the text should somehow truncated.

If applicable, please provide a codepen repro:

http://codepen.io/ipip2005/pen/WRmEbb

Repro steps:

  1. Type anything in the people picker.
  2. Select the only people "Annie Lindqvist Dough Linda Steel"
  3. See the people card is wider than people picker which looks bad.

ipip2005 avatar Feb 15 '17 11:02 ipip2005

.ms-PeoplePicker-Persona is min width of 180px, and with the button padding of 20px on each side, the min width of the people picker suggestion will be 220px.

The question is, what is the minimum width we can expect the people picker to be? Then update documentation to specify that. Is 220px too wide? If so, then what number should we go with?

image

micahgodbolt avatar Feb 16 '17 17:02 micahgodbolt

@ipip2005 It looks like the codepen does not have the latest version of fabric-react. I'll see if I can't get it updated.

joschect avatar Feb 21 '17 18:02 joschect

Hi, @joschect The codepen is always using the latest version of fabric-react from

http://spoppe-a.akamaihd.net/files/fabric/office-ui-fabric-react/latest/office-ui-fabric-react.min.js

I slightly change the code to make it easier to understand the issue: http://codepen.io/lijunle/pen/OpLzPm

Repro steps are the same as mention in https://github.com/OfficeDev/office-ui-fabric-react/issues/1006#issue-207782521

  1. Type anything in the people picker.
  2. Select the only people "Annie Lindqvist Dough Linda Steel"
  3. See the people card is wider than people picker which looks bad.

lijunle avatar Feb 22 '17 16:02 lijunle

I think this issue is duplicated with https://github.com/OfficeDev/office-ui-fabric-react/issues/1024

MirandaGe avatar Feb 24 '17 06:02 MirandaGe

.ms-PeoplePicker-Persona is min width of 180px, and with the button padding of 20px on each side, the min width of the people picker suggestion will be 220px.

@micahgodbolt I could prefer no limit about the width here. It is in BasePicker file. It makes more reasonable that, each subclass has its own width limitation.

lijunle avatar Feb 28 '17 06:02 lijunle

@lijunle We can remove the limit on the ms-peoplepicker-persona.

The codepen is not always using the latest version. I built the latest locally and created a codepen with the office-ui-fabric-react.min.js content and then linked that to a fork of your codpen. As you can see it behaves as expected.

http://codepen.io/slimemold/pen/WpQMOd

joschect avatar Feb 28 '17 18:02 joschect

Solution has been merged so updating the status.

gitjain avatar Mar 31 '17 21:03 gitjain