microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.36k stars 2.72k forks source link

[Bug]: #32979

Open miroslavstastny opened 5 hours ago

miroslavstastny commented 5 hours ago

Component

Other...

Package version

9.54.6

React version

18.2.0

Environment

-

Current Behavior

MenuItem with long text wrapped to multiple lines does not align with MenuItemRadio:

image

Expected Behavior

All items should be aligned.

Reproduction

https://stackblitz.com/edit/rw583v?file=src%2Fexample.tsx

Steps to reproduce

Open the menu and check left side of the individual items.

Are you reporting an Accessibility issue?

None

Suggested severity

Medium - Has workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

miroslavstastny commented 5 hours ago

Workaround set flex-shrink: 0 on checkmark slot.

const useStyles = makeStyles({
  menuItemCheckmark: {
    flexShrink: 0,
  },
});

//...

<MenuItem checkmark={{ className: classes.menuItemCheckmark }}>
  MenuItem that has realllllllllllllllllllllllllllllllllllllllllllllllly long text
</MenuItem>