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: S2 menu press scaling #7492

Merged
merged 2 commits into from
Dec 16, 2024
Merged

fix: S2 menu press scaling #7492

merged 2 commits into from
Dec 16, 2024

Conversation

devongovett
Copy link
Member

The refactor to usePress to remove the custom hit testing (#7427) broke S2's press scaling on menu triggers because menus open on mouse down, and when the underlay appears it covers the trigger button and the browser fires pointerleave immediately. This issue is unique to S2 because RAC already overrides isPressed on the trigger button to true, but in S2 we disabled that so that the press scaling doesn't get "stuck" while the menu is open. Now we can listen for pointerup on the document in onPressStart in S2 ourselves, and it should only remain scaled while the mouse is down.

One slight difference vs before is that if you mouse down on the button and drag away it remains in the scaled state instead of removing it like our other buttons. Is this ok or should we add more logic to handle that?

@rspbot
Copy link

rspbot commented Dec 6, 2024

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

Eh, I'm fine with the trigger button remaining pressed even when you've dragged off, we can enhance the logic if people notice haha

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

behavior is fine for me, nice catch in useGlobalListeners

@devongovett devongovett added this pull request to the merge queue Dec 16, 2024
Merged via the queue into main with commit b82d0da Dec 16, 2024
30 checks passed
@devongovett devongovett deleted the menu-press-scale branch December 16, 2024 16:23
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.

4 participants