-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
regressionthis used to workthis used to work
Description
It looks like the component is not being re-rendered when a prop in the dcc.Tab component is updated in a callback.
As reported on the forum This app works in dash 2.18.2 but not in dash 3.0.1
import dash
from dash import dcc, html, Input, Output
app = dash.Dash()
app.layout = html.Div(
[
html.Button("Enable Tabs", id="button", n_clicks=0),
dcc.Store(id="store-data", data=None),
dcc.Tabs(
[
dcc.Tab(label="Tab A", value="tab-a", id="tab-a", disabled=True),
dcc.Tab(label="Tab B", value="tab-b", id="tab-b", disabled=True),
],
id="tabs",
value="tab-a",
),
]
)
@app.callback(Output("store-data", "data"), Input("button", "n_clicks"))
def update_store_data(clicks):
if clicks > 0:
return {"data": "available"}
return None
@app.callback(
Output("tab-a", "disabled"), Output("tab-b", "disabled"),
Input("store-data", "data"),
)
def toggle_tabs(store_data):
if store_data is not None and "data" in store_data:
return False, False
return True, True
if __name__ == "__main__":
app.run(debug=True)
Metadata
Metadata
Assignees
Labels
regressionthis used to workthis used to work