'undo' does not work when actions applied to two different components consecutively
Closed this issue · 0 comments
rmarren1 commented
I noticed that 'undo' will not work if the previous two user interactions were applied to different components. For example, if interaction 1 is applied to component A and interaction 2 is applied to component B, then the undo button will do nothing. If both interactions are applied to the same component, then the last interaction will be undone as expected.
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
app = dash.Dash()
app.scripts.config.serve_locally = True
app.layout = html.Div([
html.Button(id='click', children='click'),
html.Div(id='output', children=''),
dcc.RadioItems(
id='radio',
options=[{
'label': 'good',
'value': 'good'
},
{
'label': 'bad',
'value': 'bad'
}],
value='good')
])
@app.callback(Output('output', 'children'),
[Input('click', 'n_clicks'),
Input('radio', 'value')])
def crash_it(clicks, radio):
return clicks
app.run_server(debug=True, port=8000)
Versions:
dash==0.23.1
dash-core-components==0.26.0
dash-html-components==0.11.0
dash-renderer==0.13.0