We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to make a button that changes its text upon click and triggers the next callback (plot update)
@app.callback( [Output("interval-graph", "disabled"), Output("start-record-button", "buttonText")], [Input("start-record-button", "n_clicks")], [State("interval-graph", "disabled")], ) def stop_GraphUpdate(n_clicks, current): if n_clicks == 0: return True, "Start record" return not current, "Stop Record" if current else "Start Record"
However, if I use callback_shared (which I want), page never loads and the Python script cannot be stopped with Ctrl + C.
callback_shared
Ctrl + C
Env
dash 1.13.4 dash-bootstrap-components 0.11.3 dash-core-components 1.10.1 dash-daq 0.5.0 dash-devices 0.1.3 dash-html-components 1.0.3 dash-renderer 1.5.1 dash-table 4.8.1
Describe the bug
What causes a problem is a button callback. If simplified:
import dash_devices from dash_devices.dependencies import Input, Output, State import dash_html_components as html import dash_core_components as dcc app = dash_devices.Dash(__name__) app.config.suppress_callback_exceptions = True app.layout = html.Div([ html.Button( id = 'start-stop', n_clicks=0 style={'width': 150, 'height':50, 'color':'orange'} ), ]) @app.callback_shared( Output("start-stop", "children"), [Input("start-stop", "n_clicks")], ) def button_text(n_clicks): if n_clicks == 0 or n_clicks %2 == 0: return "Start" else: return 'Stop' if __name__ == "__main__": app.run_server( debug=True, host='localhost', port = 5000)
Which leads to infinite page loading.
Expected behavior
Observed only for callback_shared, callback behaves as it should.
callback
The text was updated successfully, but these errors were encountered:
I have the same problem. Did you find a solution?
Sorry, something went wrong.
Can you please give this wheel a try to see if it fixes the issue?
https://drive.google.com/file/d/1SLYmPLQv-HdDKZIjBF14PoC7P-AD7daV/view?usp=sharing
thanks :)
yes it works now!
No branches or pull requests
I want to make a button that changes its text upon click and triggers the next callback (plot update)
However, if I use
callback_shared
(which I want), page never loads and the Python script cannot be stopped withCtrl + C
.Env
Describe the bug
What causes a problem is a button callback. If simplified:
Which leads to infinite page loading.
Expected behavior
Observed only for
callback_shared
,callback
behaves as it should.The text was updated successfully, but these errors were encountered: