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 menu item focus ring from exceeding popover boundaries #7672

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yihuiliao
Copy link
Member

@yihuiliao yihuiliao commented Jan 27, 2025

See https://github.com/orgs/adobe/projects/19/views/4?pane=issue&itemId=90609300 for an example

This happens not just with focus rings. Try with any component that uses a popover on main, make sure that scrolling appears by adjusting the height of the viewable area, and then see how items on the bottom will appear before they're actually on the popover.

chromatic: https://www.chromatic.com/build?appId=5f0dd5ad2b5fc10022a2e320&number=882

✅ 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 components like S2 Menu, Picker, Popover, Combobox, to make sure items and focus rings do not exceed the popover's borders.

🧢 Your Project:

@yihuiliao yihuiliao changed the title fix: prevent menu item focus ring from exceeding the boundaries of th… fix: prevent menu item focus ring from exceeding popover boundaries Jan 27, 2025
@rspbot
Copy link

rspbot commented Jan 27, 2025

@yihuiliao yihuiliao marked this pull request as ready for review January 27, 2025 23:32
snowystinger
snowystinger previously approved these changes Jan 28, 2025
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.

Looks good, can we run chromatic on it just in case?

@rspbot
Copy link

rspbot commented Jan 28, 2025

@@ -79,6 +79,7 @@ let popover = style({
// Don't be larger than full screen minus 2 * containerPadding
maxWidth: '[calc(100vw - 24px)]',
boxSizing: 'border-box',
display: 'flex',
Copy link
Member

Choose a reason for hiding this comment

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

possibly problematic, may affect how children are rendered, or is the child always something predictable?

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.

3 participants