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

[BUG] Dash 1.6 Datatable disables all callbacks if not in initial layout #1010

Closed
HansKallekleiv opened this issue Nov 12, 2019 · 1 comment · Fixed by #1027
Closed

[BUG] Dash 1.6 Datatable disables all callbacks if not in initial layout #1010

HansKallekleiv opened this issue Nov 12, 2019 · 1 comment · Fixed by #1027
Assignees
Milestone

Comments

@HansKallekleiv
Copy link

Describe your context

dash                 1.6.0  
dash-core-components 1.5.0  
dash-html-components 1.0.1  
dash-renderer        1.2.0  
dash-table           4.5.0  

Same issue as #998 .
If DataTable is used in the app but not included in the initial layout callbacks are not working.

Small example using dcc.Tabs below.
Here the first rendered tab has a dcc.Graph which is populated in a callback.
The second tab has a empty DashTable.
With dash > 1.5.1 it is necessary to first navigate to the tab with the DashTable before the callback on the first tab is working.

# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_table

app = dash.Dash()

app.layout = html.Div(
    children=[
        dcc.Tabs(
            children=[
                dcc.Tab(
                    children=[
                        html.Button(id="btn", children="Update graph"),
                        dcc.Graph(id="example-graph"),
                    ]
                ),
                dcc.Tab(children=dash_table.DataTable(id="example-table")),
            ]
        ),
    ]
)

@app.callback(Output("example-graph", "figure"), [Input("btn", "n_clicks")])
def update_graph(clicks):
    return {
        "data": [{"x": [1, 2, 3], "y": [4, 1, 2], "type": "bar"},],
    }

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

Describe the bug

If a dash_table.DataTable is included in the app, but not in the initial layout, app callbacks are not working. After the table has been added to the layout the callbacks works correctly.

Expected behavior
The callbacks should work.

@josephcappadona
Copy link

josephcappadona commented Nov 21, 2019

I'm also encountering this bug. Downgrading to dash==1.4.1 solved the issue for me, but I am awaiting a better workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants