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 submenus from closing on scroll #7894

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

devongovett
Copy link
Member

Fixes the "Complex content" submenu example in the docs on iPad. This was closing due to a scroll event when the virtual keyboard appeared. Close on scroll is enabled for isNonModal popovers, but we should exclude submenus from this. Another reason to eventually split up isNonModal into multiple props.

Also fixed the search field overflowing the popover on iPad in that example.

@rspbot
Copy link

rspbot commented Mar 7, 2025

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

Fixed for me, but the menu briefly flashes as the keyboard opens.

@devongovett
Copy link
Member Author

I think that's an existing issue with usePreventScroll when there are text inputs in an overlay. In that case we apply a transform to the page to avoid browser scrolling, and I guess that causes the flash...

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.

LGTM, tested on iPad, Android Chrome, and desktop browsers

@devongovett devongovett added this pull request to the merge queue Mar 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 7, 2025
@devongovett devongovett added this pull request to the merge queue Mar 7, 2025
Merged via the queue into main with commit bae640a Mar 7, 2025
30 checks passed
@devongovett devongovett deleted the fix-submenu-close-on-scroll branch March 7, 2025 23:51
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