Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard escape hides focus on Button ContextMenu #249

Open
prakhar241 opened this issue Feb 26, 2021 · 3 comments
Open

Keyboard escape hides focus on Button ContextMenu #249

prakhar241 opened this issue Feb 26, 2021 · 3 comments

Comments

@prakhar241
Copy link

prakhar241 commented Feb 26, 2021

Hello, I see a behavior where the focus is hidden when I press escape through keyboard - the button that has contextual menu.

This hides the focus may be because this is treated as button, but keyboard escape should not hide the focus, and make it visible. Actually if I remove js-focus-visible CSS, the mentioned button/contextual menu works fine.

Before writing additional CSS to gain focus, I want to confirm if you want to see this behavior and suggest if there is any resolution.

@Justineo
Copy link
Contributor

Justineo commented Feb 26, 2021

I believe this issue is related to your problem: #88

@prakhar241
Copy link
Author

prakhar241 commented Feb 26, 2021

Thanks @Justineo for mentioning the issue. This seems old thread where many things are fixed. Checking threads. We are using "focus-visible": "^5.2.0".

Given that, is there a way to fix this issue for button contextual menu? The desired experience is that the keyboard escape button should not hide focus. It should skip overriding outline style for buttons for keyboard navigations. Attaching the override CSS -
image

@prakhar241
Copy link
Author

Writing new CSS override for outline, would trigger it for mouse events as well. Also, writing the code to detect the key 'escape', and then change focus on button, might be more than what could be done here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants