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.31k stars 2.71k forks source link

[Bug]: Menu - opening menu with arrow down unexpectedly scrolls the menu list if there is scrollbar #32368

Open jurokapsiar opened 3 weeks ago

jurokapsiar commented 3 weeks ago

Library

React Components / v9 (@fluentui/react-components)

System Info

any system in the universe

Are you reporting an Accessibility issue?

no

Reproduction

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

Bug Description

Actual Behavior

Menu opens and it is scrolled

Expected Behavior

Menu opens without any scrolling

Logs

No response

Requested priority

High

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

micahgodbolt commented 3 weeks ago

menu_arrow

miroslavstastny commented 2 weeks ago

Workaround: add preventDefault to onKeyDown:

          <MenuButton
            onKeyDown={(e) => {
              if (e.key === 'ArrowDown') {
                e.preventDefault();
              }
            }}
          >
            Trigger
          </MenuButton>
swapanmandi commented 1 week ago

Remove and add custom CSS