-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat(tabs): make non-fitted tabs responsive #3857
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
🦋 Changeset detectedLatest commit: 19498cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 19498cd. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 3 targetsSent with 💌 from NxCloud. |
Size Change: +1.2 kB (0%) Total Size: 1.03 MB
ℹ️ View Unchanged
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 19498cd:
|
Passing run #7970 ↗︎
Details:
Review all test suite changes for PR #3857 ↗︎ |
b11e7bd
to
98d431f
Compare
This is blocked on an accessiblity issue where my solution added wrappers for the scrollbar around the individual tabs and the tab wrapper. The tabs need to be direct children of the tab wrapper, and it is causing screenreaders to not correctly link the two elements together. A solution would be to use aria- tags to connect them, but I didn't have great success with it in my preliminary tests. This requires more experimentation. Another solution would be to move my wrappers outside the tabWrapper rather than between it and the tabs, and then update the styling accordingly to make this solution work. I haven't explored this, and is just an idea. |
I went to great lengths to use a native scrollbar solution and style it such that I wouldn't need a pure JS built scrollbar.
In order to achieve this, I needed to add two wrapper divs to the TabList component. One for the outer scrollbar, and one for the bottom border. I still need some JS to fetch the total width of the TabList in order to position the bottom border correctly cross-browser, and to offset the scrollbar position by 4px on the outside of the element visually.
I also made the Tabs component scroll to the selected tab on mount, if it is off-screen. This initial scroll happens instantly to avoid screen noise. Subsequent tab navigation will smoothly scroll to the selected tab to provide a more refined experience.
Fitted tabs do not receive any significant changes, as by definition they shouldn't overflow or scroll.
Vertical tabs have similarly remained untouched.
I tested these changes thoroughly on Safari, Firefox, and Chrome, and checked the browser support tables for the features I'm using to verify they pass our requirements.
Chrome
Firefox
Safari