-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Compare sheet won't close on esc if input focused #6246
Comments
Hey there! I tested this on the latest version of DIM on Chrome 125/Windows 11, and I cannot reproduce the issue. When pressing "Escape" the sheet will close even if a button inside of the sheet is focused. Are you still able to reproduce the issue? |
Thanks for taking a look. The specific repro I had was on Windows and involved focusing a text field (e.g. the title of a loadout). |
Thanks for the additional info! I'm able to reproduce this issue on both Windows and macOS. It looks like this check is the culprit. The issue is "fixed" if I remove that check, but it looks like this logic was implemented for a particular reason. Do you have any additional context as to why this check is here? I'd be happy to make a PR if you have suggestions for how to correctly fix this. |
Yeah that code was brought over from Mousetrap. My understanding is that it's meant to avoid overriding builtin input hotkeys (including typing letters) with your custom hotkeys. |
Thanks for the added info! I looked on the original mousetrap repo and found an issue that seems related. Adding a My knowledge of the DIM codebase is still fairly limited, but I can think of a few possible ways of solving this issue:
Is there a particular approach you'd prefer? |
Probably number 2 - esc should bubble out of the input. However, it's interesting that this isn't a problem on macOS. |
Thanks! I opened a PR here: #10478 |
What version of DIM are you using?
Beta 6.40.0.9199
What Browser and OS are you using?
Chrome 86.0.4240.198 / Win10
Describe the bug and how to make it happen
On compare, if a button or combo is selected/focused, esc won't dismiss/close it. Only unfocusing (clicking on an empty area) that it'll work again.
Include devtools console logs
Nothing specifc to the issue.
The text was updated successfully, but these errors were encountered: