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

AutoComplete, when in dialog, intercepts escape keypresses and click outside #3003

Closed
mattcosta7 opened this issue Mar 9, 2023 · 4 comments · Fixed by #3087
Closed

AutoComplete, when in dialog, intercepts escape keypresses and click outside #3003

mattcosta7 opened this issue Mar 9, 2023 · 4 comments · Fixed by #3087
Assignees

Comments

@mattcosta7
Copy link
Collaborator

Description

see #2995 for some setup

When Autocomplete is used inside a dialog, Escape to close the dialog fails - seemingly because the AutoComplete overlay intercepts these keypresses before they get tot he containing dialog - even when the autocomplete is not currently focuses (so the overlay itself is not visible)

Steps to reproduce

Autocomplete in a dialog, rendered in a deferred way to ensure that it orders ontop of the dialog content.

Attempt to close the dialog with escape - note the dialog is not closeable, and the handler is never called

Version

v35.20.0

Browser

No response

@mattcosta7 mattcosta7 added the bug Something isn't working label Mar 9, 2023
@mattcosta7
Copy link
Collaborator Author

mattcosta7 commented Mar 9, 2023

cc @stephanieg0 who noticed this behavior

@mattcosta7
Copy link
Collaborator Author

Looks like this also impacts "click outside to close behavior"

@mattcosta7 mattcosta7 changed the title AutoComplete, when in dialog, intercepts escape keypresses AutoComplete, when in dialog, intercepts escape keypresses and click outside Mar 9, 2023
@stephanieg0
Copy link

Just adding this here for visibility.
I had to change some playwright tests that used page.keyboard.press('Escape') to instead do page.click('[aria-label=Close]')

https://github.com/github/github/pull/263278/commits/08caa7ce06659b9d8ea15c8c420b4338a753f0d7
https://github.com/github/github/pull/263278/commits/2438a66a2da80c5f61b43f1c54add4aff3310453

@green6erry
Copy link
Contributor

@mperrotti Here's the original ticket. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment