question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tabs component makes page scroll jump

See original GitHub issue

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Describe in detail the issue you’re having.

The Tabs component makes the page jump when the user clicks on a tab so the tab is placed at the top of the viewport. This causes a problem because our platform shell header ends up covering the tabs when clicked. tab_scroll_down

Is this issue related to a specific component?

Yes, the Tabs component

What did you expect to happen? What happened instead? What would you like to see changed?

It is expected that selecting a tab on the Tabs component does not change the user’s scroll position.

What browser are you working in?

Google Chrome Version 86.0.4240.111 (Official Build) (x86_64)

What version of the Carbon Design System are you using?

Carbon Components React 7.22.0

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

Cloud Pak for Security release in mid-November

Steps to reproduce the issue

  1. Go to the Tabs Storybook preview
  2. Adjust the preview viewport size so that the content is vertically scrollable with a combination of making the browser window short and increasing the size of the preview
  3. Scroll the preview viewport so that the Tab buttons are partially visible
  4. Click on any Tab button
  5. Notice that the scroll position jumps to place the clicked Tab button at the top of the viewport

Please create a reduced test case in CodeSandbox https://codesandbox.io/s/wonderful-bassi-uzdi2?file=/src/index.js

Additional information

Kapture 2020-10-27 at 13 17 40

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
diego-codescommented, Oct 29, 2020

Great! Thanks, @emyarod. I think I have enough information to move forward. I will close this issue.

1reaction
diego-codescommented, Oct 27, 2020

You can even see the same behavior on this demo page: https://www.carbondesignsystem.com/components/tabs/usage/ Kapture 2020-10-27 at 18 31 06

Read more comments on GitHub >

github_iconTop Results From Across the Web

JQuery UI Tabs Causing Screen to "Jump" - Stack Overflow
In most cases, the jumping isn't caused by the browser following the '#' link. The page jumps because at the midpoint of the...
Read more >
Building a Tabs component - web.dev
A foundational overview of how to build a tabs component similar to those found in iOS and Android apps.
Read more >
Content Jumping (and How To Avoid It) | CSS-Tricks
If the content ends up making the element taller, it can still do that, which isn't great, but it's slightly better than doing...
Read more >
Tabs | Webflow University
To add the tabs element, go to the Add panel and scroll down to the components section. Then click and drag the Tabs...
Read more >
overscroll-behavior - CSS: Cascading Style Sheets | MDN
By default, mobile browsers tend to provide a "bounce" effect or even a page refresh when the top or bottom of a page...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found