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

Fix detection of modifiers on Firefox in textarea or input and modifiers sent through virtual keycodes #986

Merged
merged 4 commits into from
May 23, 2024

Conversation

Kuuuube
Copy link
Member

@Kuuuube Kuuuube commented May 22, 2024

More Firefox bugs/inconsistencies yay!

For KeyboardEvent, when modifiers are pressed on Firefox without any other keys and the focus is in a textarea or input, the keydown event does not contain the last pressed modifier as event.{modifier}. This also occurs when modifiers are sent through virtual keycodes (often the result of software keyboard remapping).

Chrome and Firefox (outside of a textarea or input) do report the modifier in both the event.{modifier} and the event.code so we must check if the modifier has already been added to not duplicate it.

The textarea and input part of this usually doesn't matter (we already don't allow scanning without mousemove in an input or textarea) but it makes it very annoying to set up modifier only keybinds for shortcuts. You had to press more keys than were actually being set to get it to work correctly which is terrible UX and I'm sure some users wouldn't figure this out and just give up thinking we didn't support that.

@Kuuuube Kuuuube added kind/bug The issue or PR is regarding a bug area/ui-ux The issue or PR is related to UI/UX/Design labels May 22, 2024
@Kuuuube Kuuuube requested a review from a team as a code owner May 22, 2024 18:09
@Kuuuube Kuuuube changed the title Fix detection of modifiers on Firefox in textarea and input Fix detection of modifiers on Firefox in textarea or input and modifiers sent through virtual keycodes May 23, 2024
@Kuuuube
Copy link
Member Author

Kuuuube commented May 23, 2024

Expanded this to fix modifiers sent through virtual keycodes on firefox as well.

Copy link
Collaborator

@jamesmaa jamesmaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure what's going on but :shipit:

@jamesmaa jamesmaa added this pull request to the merge queue May 23, 2024
Merged via the queue into yomidevs:master with commit bbb1966 May 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-ux The issue or PR is related to UI/UX/Design kind/bug The issue or PR is regarding a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants