Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Tabs - Callback-less version has the 2nd tab selected by default instead of the first #262

Closed
chriddyp opened this issue Aug 13, 2018 · 1 comment
Assignees
Labels
dash-type-bug Something isn't working as intended in progress

Comments

@chriddyp
Copy link
Member

# -*- coding: utf-8 -*-
import dash
import dash_html_components as html
import dash_core_components as dcc

from dash.dependencies import Input, Output, State

app = dash.Dash()

app.layout = html.Div([
    dcc.Tabs(id="tabs", children=[
        dcc.Tab(label='Tab one', children=[
            html.Div([
                dcc.Graph(
                    id='example-graph',
                    figure={
                        'data': [
                            {'x': [1, 2, 3], 'y': [4, 1, 2],
                                'type': 'bar', 'name': 'SF'},
                            {'x': [1, 2, 3], 'y': [2, 4, 5],
                             'type': 'bar', 'name': u'Montréal'},
                        ]
                    }
                )
            ])
        ]),
        dcc.Tab(label='Tab two', children=[
            html.Div([
                html.H1("This is the content in tab 2"),
            ])
        ]),
        dcc.Tab(label='Tab three', children=[
            html.Div([
                html.H1("This is the content in tab 3"),
            ])
        ]),
    ])
])


if __name__ == '__main__':
    app.run_server(debug=True)

image

@chriddyp chriddyp added the dash-type-bug Something isn't working as intended label Aug 13, 2018
@chriddyp
Copy link
Member Author

This has now been documented in https://github.com/plotly/dash-docs/pull/139. So, when this issue is fixed, we should update our documentation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dash-type-bug Something isn't working as intended in progress
Projects
None yet
Development

No branches or pull requests

2 participants