-
Notifications
You must be signed in to change notification settings - Fork 5
MOOSE-333: Scroll vertical tabs into view on mobile after selection #306
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
base: main
Are you sure you want to change the base?
Conversation
When a vertical tab is clicked on mobile, the viewport now scrolls to show the selected tab at the top. Added scroll-margin-top to account for the sticky header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements automatic scrolling functionality for vertical tabs on mobile devices. When a tab is selected, the viewport smoothly scrolls to bring that tab into view at the top of the screen, while respecting user accessibility preferences for reduced motion.
Changes:
- Added CSS scroll margin to account for sticky header positioning on mobile
- Implemented JavaScript scroll behavior that activates only on mobile when tabs merge
- Updated changelog to document the fix
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| wp-content/themes/core/blocks/tribe/vertical-tabs/style.pcss | Adds scroll-margin-top for mobile to account for sticky header height |
| wp-content/themes/core/assets/js/utils/tabs.js | Implements scrollIntoView behavior on mobile with reduced motion support |
| CHANGELOG.md | Documents the fix for vertical tabs scrolling behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GeoffDusome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 Looks good to me; I think we initially had it this way but we removed it for some reason.
dpellenwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📗
What does this do/fix?
When a vertical tab is clicked on mobile, the viewport now scrolls to show the selected tab at the top. It also takes into consideration
prefers-reduced-motionwhen animating in.QA
Links to relevant issues
Screenshots/video:
Pull request checklist