Skip to content
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 - 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

Comments

@chriddyp
Copy link
Member

commented Aug 13, 2018

# -*- 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 Type: Bug label Aug 13, 2018

chriddyp added a commit to plotly/dash-docs that referenced this issue Aug 13, 2018

🐛 document tab bugs so that there aren't any surprises for our users
- resize issue:
plotly/dash-core-components#256
- tab 2 by default issue:
plotly/dash-core-components#262

Once those issues are resolved, we should remove these items from the
docs
@chriddyp

This comment has been minimized.

Copy link
Member Author

commented Aug 13, 2018

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

chriddyp added a commit to plotly/dash-docs that referenced this issue Aug 13, 2018

🐛 document tab bugs so that there aren't any surprises for our users
- resize issue:
plotly/dash-core-components#256
- tab 2 by default issue:
plotly/dash-core-components#262

Once those issues are resolved, we should remove these items from the
docs

chriddyp added a commit to plotly/dash-docs that referenced this issue Aug 13, 2018

🐛 document tab bugs so that there aren't any surprises for our users
- resize issue:
plotly/dash-core-components#256
- tab 2 by default issue:
plotly/dash-core-components#262

Once those issues are resolved, we should remove these items from the
docs

valentijnnieman added a commit that referenced this issue Aug 17, 2018

Dash - Stable and Extensive Core Component Libraries automation moved this from To do to Done Aug 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.