-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(react): add horizontal overflow to Tabs in v11 #10799
feat(react): add horizontal overflow to Tabs in v11 #10799
Conversation
…at/horizontal-overflow-tabs
✔️ Deploy Preview for carbon-react-next ready! 🔨 Explore the source changes: bb8932c 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/621fd0c39915b50008c4565a 😎 Browse the preview: https://deploy-preview-10799--carbon-react-next.netlify.app |
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: bb8932c 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/621fd0c3a2449500074260fe 😎 Browse the preview: https://deploy-preview-10799--carbon-elements.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: bb8932c 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/621fd0c344bc4a00086ae45f 😎 Browse the preview: https://deploy-preview-10799--carbon-components-react.netlify.app |
…at/horizontal-overflow-tabs
…y-carbon-fork into feat/horizontal-overflow-tabs
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.
Could we call scrollIntoView
on a tab when it's selected? Selecting "Tab 5" here leaves it out of view.
selected.doesnt.scroll.into.view.mov
Otherwise looks solid to me!
…y-carbon-fork into feat/horizontal-overflow-tabs
I think I broke it. When I press and hold to the end I can't go back to the left no matter what I click Screen.Recording.2022-03-02.at.1.57.55.AM.mov |
@aledavila Yeah it was :/ that should be fixed now if you want to check it out! |
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.
Yes! Looks great 🚀
…stem#10799) * chore: check in progress * chore: check in progress * chore: check in progress * chore: check in progress * chore: check in progress * feat(react): add horizontal overflow to tabs * fix(react): adjust styles * feat(react): add horizontal overflow to tabs * chore(react): remove extraneous changes * chore(react): remove extraneous changes * fix(react): update snapshots and failing test * fix(react): replace use layout with use isomorphic * fix(react): fix incorrect import * fix(react): scroll tab into view when clicked * fix(react): scroll tab into view when clicked * feat(tabs): update scroll position on click * fix(tabs): update usePressable and fix interop with long press * fix(tabs): update animation mechanism and fix safari text selection issue * fix(tabs): add will-change: scroll-position * chore(tabs): remove extra comments on usePressable * fix(react): adjust next button visible and remove transparent keyowrd Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com> Co-authored-by: Josh Black <josh@josh.black>
Closes #10249
This was a doozy.
usePressable
. By default, the events are called in this order: onMouseDown -> onMouseUp -> onClick. Because of this, usePressable coordinates whenonClick
,onMouseDown
, andonMouseUp
are called so that onMouseDown isn't called when a user just clicks and that, if a user has been pressing and holding onMouseDown,onClick
isn't called after it's released.Testing / Reviewing
Go to the Tabs stories in
next
storybook and try out the horizontal overflow, holding press and just clicking. The first story has been changed to be in a small container so you can mess around with it (I'll remove before merging).With the other stories, test out that the overflow updates appropriately on resize.