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: prevent context menu highlight from persisting for touch input #2297

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

mgreminger
Copy link
Contributor

@mgreminger mgreminger commented Feb 15, 2024

When using touch input with the context menu, all of the previously clicked context menu items remain highlighted when the context menu is reopened (see first screen recording below, tested on Chrome and Edge). This change ensures that the most recently clicked item will be returned to the non-active state after the event fires. I think the root cause of the issue is that the pointerenter and pointerleave don't both fire for touch input so the accounting of activeMenuItem is not working the same way as it does for mouse events. I tried setting touch-action: none on the menu items as a alternative solution, but that did not work.

Screen Recording of Previous Behavior:
before_context_menu_fix.webm

Screen Recording of Behavior After Proposed Change:
after_context_menu_fix.webm

@arnog
Copy link
Owner

arnog commented Feb 15, 2024

Ah, yes, thank you. I had noticed this and it had slipped my mind... That's the correct fix.

@arnog arnog merged commit 28cda7c into arnog:master Feb 15, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants