-
Notifications
You must be signed in to change notification settings - Fork 116
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(responsive-tabs): allow scroll on components with tabs #4067
Conversation
…eat/responsive-tabs
Run & review this pull request in StackBlitz Codeflow. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: ecdbdd4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 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 |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit ecdbdd4. 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 1 targetSent with 💌 from NxCloud. |
Size Change: +4.3 kB (0%) Total Size: 1.1 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 ecdbdd4:
|
Paste Run #8867
Run Properties:
|
Project |
Paste
|
Run status |
Passed #8867
|
Run duration | 02m 07s |
Commit |
ecdbdd48c2: Merge branch 'main' of github.com:twilio-labs/paste into feat/responsive-tabs
|
Committer | Kristian Antrobus |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
67
|
packages/paste-core/components/in-page-navigation/src/OverflowButton.tsx
Outdated
Show resolved
Hide resolved
packages/paste-core/components/code-block/src/OverflowButton.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Sarah <[email protected]>
.getElementById(selectedId) | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore - behavior is typed incorrectly in Typescript v4, fixed in v5+ | ||
?.scrollIntoView({ behavior: prevSelectedTab === undefined ? "instant" : "smooth" }); |
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.
Hi @krisantrobus,
This PR introduced some weird behavior since it applies to all Tabs
variations including vertical ones. When used with vertical tabs scrollIntoView
obviously scrolls both vertically and horizontally until a tab header is visible which causes an annoying experience when you need to scroll up to revert this unintended view change.
Could this be please fixed?
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.
Hey @dmitriy-kudelko apologies for this. Working on a fix and will update once we have a PR up
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.
PR is up and we are reviewing internally: #4143
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.
Cool. Thanks!
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.
Hi @dmitriy-kudelko we have rolled out the fix for this and it is now available in version 20.18.0. I hope this resolves all issues you were seeing.
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.
@krisantrobus , great news. Thank you for implementing this feature and for quickly releasing a fix! 👍
We've been waiting for it and have already applied it to some places on the UI.
BTW, there seems to be also an issue with the inability to scroll tabs till the very end. As a result the last tab is partially cut. Clicking on the right arrow doesn't seem to help either. The left boundary doesn't have this problem. Not sure if it's something on our end, but we don't have any margin/padding customizations for the Tabs component which could explain that. It doesn't seem to depend on the window width either. I attached a video:
tabs.mov
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.
Hmm this is very strange and something we have not encountered. Could you share more details. What is the viewport width you are using and number of tabs. If you could replicate in a codesandbox that would be be very helpful. Also are you able to use the tab key to highlight a tab and use arrow keyboard buttons to get to the very last item?
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.
@dmitriy-kudelko I could not replicate it in our strorybooks when making some page compositions, however I did find it in a deploy preview for our Paste upgrade in one of our internal tools. I will be working on this again tomorrow and we should see another path. Again, so sorry for these issues
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.
Hi @dmitriy-kudelko I have validated the fix in 20.18.1 and I can confirm the issue has been resolved.
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.
Hi @krisantrobus , nice! Thank you so much!
Added scroll functionality to components with tabs: