-
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
Tabs component scrolls tabs into view on click, no way to stop this behaviour #6973
Comments
This is still an issue for us. If anything, the fix #6974 makes it worse (see my next comment for a demo of the worsened behavior). Any use of I'm pretty sure that this bug would be truly fixed if you switch to What I have done in this gif: first, I click around tabs with the element scrolled to the top of the viewport. No problem. And #6974 actually made this part better. However, once I scroll down a bit, switching tabs causes a vertical scrolling event. This can be highly problematic, because it may cause the content of the tab to go from on-viewport to fully off-viewport (see the next comment for a gif of that behavior). |
Here is a second gif that shows the catastrophic case: to start, the tab content is fully in-viewport, whereas upon clicking on a tab, the tab content scrolls to be fully off-viewport! What I have done in the gif: first, I demonstrate that I am scrolled to the bottom of the viewport. Then I click on a tab, and observe the vertical scrolling event that pushes the tab content off-viewport to the bottom. Prior to #6974 the problem was annoying. With #6974, you get these kinds of "catastrophic" situations, where the tab content move to fully off-viewport. That is, prior to #6974, no test failures, just sub-optimal behavior. With #6974 we get test failures. |
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
When using the tabs and tab component, selecting on a tab (click or keyboard) the component will scroll the window such that the tabs component is at the top.
Tabs, tab
This causes unwanted behaviour in my usecase, there should be a way to turn this off, perhaps via a boolean prop.
Firefox, chrome
Latest for all packages (x.21)
IBM Cloud Docs
Steps to reproduce the issue
Additional information
This line here is causing the issue: https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/Tabs/Tabs.js#L232
Looks like it's scrolling both x and y axis when it should only be scrolling x. I can open a PR to fix if needed.
The text was updated successfully, but these errors were encountered: