fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Image ChoiceGroup text clips on overflow

Open Jahnp opened this issue 6 years ago • 4 comments

Environment Information

  • Package version(s): 7.88.0 (on the main uifabric.io website)
  • Browser and OS versions: Windows 10 Chromium Edge

Please provide a reproduction of the bug in a codepen:

https://codepen.io/jahnp/pen/RwPbbMb?editable=true

This currently repros on the website@OUFR v7.88.0, on the ChoiceGroup page: image

Actual behavior:

Overflow text is cut off and parts of letters are not visible, even if it would fit within the choice field container. This is likely to prevent overflow text from "touching" the edge of the container, which might be unattractive for longer texts, but it looks odd when the strings are shorter.

Expected behavior:

Overflow text for shorter strings are handled more gracefully, or a title/tooltip is provided to handle overflow for longer strings.

Priorities and help requested:

Are you willing to submit a PR to fix? Yes, but I don't have a lot of personal bandwidth (opening on behalf of a colleague)

Requested priority: Normal

Products/sites affected: SharePoint

Jahnp avatar Feb 03 '20 23:02 Jahnp

@Jahnp - thanks for reporting! let me check with design on what the best experience should be. multi-line truncation can potentially cause perf problem so I'm not sure if we should do that within the control. just to point out, we have onRenderLabel prop which should allow you work around the problem while I explore the fix here.

also the problem with "long" in the 2nd line being cutoff in your codepen example, that is definitely a bug. i will fix :)

xugao avatar Feb 04 '20 01:02 xugao

@Jahnp - actually, it's little unclear to me what experience you are expecting here with truncated long text. pls take a look at this PR and let me know if it resolves the issue.

xugao avatar Feb 04 '20 01:02 xugao

@xugao wow, awesome—thank you for the very swift response. Agreed that the ideal solution may be unclear and probably merits a spec, but I checked out your PR and also agree with the assumptions you made re: truncation (classic problem). And, thanks for the tip re: onRenderLabel—I should have looked more closely at the interface.

Truthfully, I filed this issue on behalf of a product team who I believed simply viewed the text clipping as the bug, which your PR fixes :) I don't think there was a specific expectation around the proper truncation behavior.

Jahnp avatar Feb 04 '20 03:02 Jahnp

:tada:This issue was addressed in #11862, which has now been successfully released as [email protected].:tada:

Handy links:

msft-github-bot avatar Feb 05 '20 12:02 msft-github-bot