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 submenu safe area edge case #5866

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Fix submenu safe area edge case #5866

merged 2 commits into from
Feb 14, 2024

Conversation

reidbarber
Copy link
Member

@reidbarber reidbarber commented Feb 13, 2024

For RSP and RAC submenus.

There was an edge case where the submenu may close unexpectedly. To reproduce it, you could:

  1. Move your pointer over the trigger item, then down to the submenu
  2. Move your pointer back to the trigger item, but immediately back out to the submenu when the trigger was entered.

A stale previous pointer position state was being used, so the pointer movement angle used was inaccurate, so the submenu closed. Now that we properly reset the previous pointer position, this doesn't occur.

Previous (broken) behavior:

broken.mov

New (working) behavior:

working.mov

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Try the reproduction steps above in RAC and RSP submenu stories.

🧢 Your Project:

@rspbot
Copy link

rspbot commented Feb 13, 2024

@adobe adobe deleted a comment from rspbot Feb 13, 2024
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.

this feels much better, nice find!

Copy link
Member

@yihuiliao yihuiliao left a comment

Choose a reason for hiding this comment

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

lgtm

@rspbot
Copy link

rspbot commented Feb 14, 2024

@rspbot
Copy link

rspbot commented Feb 14, 2024

## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@reidbarber reidbarber merged commit 5b9e89e into main Feb 14, 2024
26 checks passed
@reidbarber reidbarber deleted the safe-area-edge-case branch February 14, 2024 05:17
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

4 participants