You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for allow_duplicate, it's a very nice addition.
Everything works well, except for clientside_callback. Support for clientside_callback was supposed to be? When adding allow_duplicate, an error occurs:
If you specify several ouputs(with and without allow_duplicate), then even though there will be an error, the value will be updated for ouput without allow_duplicate, but not for output with allow_duplicate, example:
Tell me, am I doing something wrong? Thank you very much.
Full code sample (with one callback, but I think this is enough to show the error):
importdashfromdashimportDash, html, Input, Outputapp=Dash(__name__)
app.layout=html.Div(
children=[
html.Div(
children=['Last pressed button: ', html.Span(id='span', children='empty')]
),
html.Button(
id='button-right',
children='right'
)
]
)
# NOT WORKING FOR "SPAN", BUT WARKING FOR BUTTON-RIGHTdash.clientside_callback(
""" function(n_clicks){ return ["right", `right ${n_clicks}`]; } """,
[
Output('span', 'children', allow_duplicate=True),
Output('button-right', 'children')
],
Input('button-right', 'n_clicks'),
prevent_initial_call=True
)
# WORKING EXAMPLE TO UNDERSTAND HOW IT SHOULD BE (THE ONLY DIFFERENCE IS THAT NO ALLOW_DUPLICATE)# dash.clientside_callback(# """# function(n_clicks){# return ["right", `right ${n_clicks}`];# }# """,# [# Output('span', 'children'),# Output('button-right', 'children')# ],# Input('button-right', 'n_clicks'),# prevent_initial_call=True# )if__name__=='__main__':
app.run_server(debug=True, port=2414)
Thanks for allow_duplicate, it's a very nice addition.
Everything works well, except for clientside_callback. Support for clientside_callback was supposed to be? When adding allow_duplicate, an error occurs:
If you specify several ouputs(with and without allow_duplicate), then even though there will be an error, the value will be updated for ouput without allow_duplicate, but not for output with allow_duplicate, example:
Tell me, am I doing something wrong? Thank you very much.
Full code sample (with one callback, but I think this is enough to show the error):
Originally posted by @FatHare in #2414 (comment)
The text was updated successfully, but these errors were encountered: