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

'undo' does not work when actions applied to two different components consecutively #66

Closed
rmarren1 opened this issue Aug 9, 2018 · 0 comments · Fixed by #67
Closed

Comments

@rmarren1
Copy link
Contributor

rmarren1 commented Aug 9, 2018

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.

Reproducible example:
ezgif com-video-to-gif 1

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
rmarren1 added a commit to rmarren1/dash-renderer that referenced this issue Aug 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant