fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Bug]: Commandbar calculates an error after modifying the global text spacing

Open General-Zhang opened this issue 1 year ago • 7 comments

Library

Reac / v8 (@fluentui/react)

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11500 @ 2.70GHz
    Memory: 3.22 GB / 15.73 GB
  Browsers:
    Edge: Spartan (44.22621.2134.0), Chromium (116.0.1938.62)
    Internet Explorer: 11.0.22621.1

Are you reporting Accessibility issue?

None

Reproduction

https://github.com/microsoft/fluentui/assets/41287016/223d2016-1edd-43df-98db-5c1df1bdd7b8

Bug Description

Actual Behavior

After the word spacing is changed, the Commandbar is not calculated according to the changed width, resulting in an abnormal display. This can cause dyslexia for people with poor eyesight.

Expected Behavior

After changing the text spacing, Commandbar calculates the correct width, which can be recalculated based on the modified width after the calculation update is triggered

Here are the modified font styles: *{line-height:1.5 !important;letter-spacing:0.12em !important;word-spacing:0.16em !important;}p{margin-bottom:2em !important;}

The following is the reproduced page address: https://developer.microsoft.com/en-us/fluentui#/controls/web/commandbar

The following is a reproduced video: https://github.com/microsoft/fluentui/assets/41287016/223d2016-1edd-43df-98db-5c1df1bdd7b8

Logs

No response

Requested priority

High

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] The provided reproduction is a minimal reproducible example of the bug.
### Tasks

General-Zhang avatar Sep 05 '23 05:09 General-Zhang

@General-Zhang When the Commandbar component is isolated (and not within the docsite context), this issue doesn't seem to repro.

https://github.com/microsoft/fluentui/assets/8649804/089dcb88-b3a6-42a4-880a-bd68dcea5286

TristanWatanabe avatar Sep 05 '23 21:09 TristanWatanabe

This problem needs to be triggered when there is little space in the middle. When the spacing is small enough, modify the text spacing, and the internal button will be squeezed out of the normal visual range. After change font spacing call 'componentRef. Current. Remeasure ()' display does not change. I think this is a problem due to caching. The recalculation does not compute the word spacing modification, but instead uses the cached element size.

image

General-Zhang avatar Sep 06 '23 14:09 General-Zhang

This bug is reproducible.

https://github.com/microsoft/fluentui/assets/41287016/b4f3ce9d-b81a-4de8-ab0e-bb99df84d7a3

General-Zhang avatar Sep 14 '23 03:09 General-Zhang

no assignees

Gentle ping that this issue needs attention.

Because this issue has not had activity for over 180 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@TristanWatanabe - This is reproducible and even with extra gap between primarySet of options in the commandbar. It breaks the responsiveness..

p-rk avatar Apr 24 '24 20:04 p-rk

The issue remains. This is the code for the issue reproduction.

https://github.com/microsoft/fluentui/assets/41287016/09be8cc5-833a-42b3-8552-e20969d73091

bug-repro.zip

General-Zhang avatar Apr 29 '24 06:04 General-Zhang