Skip to content

Add n_clicks_previous to buttons to mimic new dash-html-components logic #60

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

Closed
mjclawar opened this issue Feb 23, 2018 · 1 comment · Fixed by #61
Closed

Add n_clicks_previous to buttons to mimic new dash-html-components logic #60

mjclawar opened this issue Feb 23, 2018 · 1 comment · Fixed by #61

Comments

@mjclawar
Copy link
Member

Discussion

As discussed in plotly/dash-html-components#37, buttons are much more convenient when the user can determine which button was clicked in the case where multiple buttons are used for a callback.

Adding an n_clicks_previous prop to at least RaisedButton and FlatButton would clean up a lot of logic in downstream code.

@coralvanda
Copy link
Contributor

Although there are two updates to props, the single click event fired off appears to hit the server only one time per button press. Watch the POST updates in the console in this gif as each button is clicked.

button-test

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

Successfully merging a pull request may close this issue.

2 participants