Skip to content

First click on an inactive tab in a tab bar scrolls the page all the way to the top #3778

@marcussjoholm

Description

@marcussjoholm

Bug description

When using tabs, activating another tab than the active one scrolls the browser to the top which is annoying and disrupts the flow. The bug is even in the Gitbook docs (see the attached recording)

How to reproduce

  1. I used Chrome Version 141.0.7390.123 (Officiell version) (arm64) on macOS Sequoia (15.6)
  2. Go to https://gitbook.com/docs/creating-content/blocks/tabs or any gitbook site with tabs
  3. Click a tab that is not showing and you are scrolled all the way to the top. Subsequent tab clicks are fine.

I'm only speculating here but it looks like it breaks the first time the anchor tag is appended to the URL

Additional context

The upload failed so I posted a new comment with it below

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions