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.52k stars 2.73k forks source link

[Bug]: Esc key doesn't work for command bar button if it is a contextual menu button and in overflow menu #32871

Closed alton-browsing closed 4 weeks ago

alton-browsing commented 1 month ago

Library

React / v8 (@fluentui/react)

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
    Memory: 33.57 GB / 63.95 GB
  Browsers:
    Edge: Chromium (127.0.2651.105)
    Internet Explorer: 11.0.22621.3527

Are you reporting an Accessibility issue?

yes

Reproduction

https://codepen.io/alton25/pen/XWLvByo

Bug Description

To reproduce the issue, click on the overflow button (the three dots) then click on the columns button that shows up in the overflow menu and then try to click esc from that context menu that shows up.

Actual Behavior

Esc key doesn't dismiss the contextual menu pop up

image

Expected Behavior

Esc key should dismiss the contextual menu pop up

Logs

No response

Requested priority

Normal

Products/sites affected

intune.microsoft.com

Are you willing to submit a PR to fix?

no

Validations

alton-browsing commented 1 month ago

It does look like that solves as a workaround, thanks! Ill keep the discussion open in case it actually isn't intended and onDismiss should also esc.


spmonahan commented 1 month ago

@alton-browsing I'm not able to repro in Edge. Are you still able to repro the issue?

alton-browsing commented 1 month ago

Yea, it still repros. Sorry I had the workaround code in there but I have since swapped it back to onDismiss (instead of onMenuDismiss)

sopranopillow commented 4 weeks ago

seems like it only reproes when onDismiss is provided. Since the workaround does work and we are avoiding making changes to v8 unless necessary, we'll close it as won't fix.

FYI for future reference, using onMenuDismiss instead of onDismiss will get the same result.