plotly / plotly/dash

[BUG] dbc Tabs not showing default first tab anymore with Dash 4.2.0 and higher

Open
#3,929 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P1 size: 3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

For any Dash version > 4.1.0, the dash-bootstrap-components (dbc) Tabs do not show the default 1st tab anymore.

With dash==4.1.0 and dash-bootstrap-components==2.0.4

Image

With dash==4.4.1 and dash-bootstrap-components==2.0.4

Image

With the following trivial example:

from dash import Dash, html
import dash_bootstrap_components as dbc

app = Dash(__name__, title="Dash Tab Test", external_stylesheets=[dbc.themes.BOOTSTRAP])

children = [dbc.Tab(html.H2(f"Test Tab {i}"), label=f"Tab {i}") for i in range(3)]

app.layout = (
    html.Div(
        [
            dbc.Tabs(children=children)
        ]
    ),
)


if __name__ == "__main__":
    app.run(debug=True)

Note: if you switch on the tabs back and forth, the tab contents appear again. It's just the first tab does not show up anymore by default. See also dbc documentation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Python example in the issue and reproduce it with Dash 4.1.0 versus 4.4.1 and dash-bootstrap-components 2.0.4. Trace the Tabs rendering and default-selection behavior; done when the first tab's contents appear on initial load and switching between tabs still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.