i have a layout with several dcc.Input to handle user input;
but i found that it’s very slow when user type in characters in the input box. this is before user click “enter” or ‘submit’ button, so i suppose the backend callback not triggered yet;
what’s wrong here and is there anyway to speed up?
Use State
(Part 2. Basic Callbacks | Dash for Python Documentation | Plotly) or update on enter/blur (Input | Dash for Python Documentation | Plotly)
thanks for response, but i’ve already used Stat paradigm:
actually the callback is correctly triggered after the button clicked, but still before that the type in the input box is very slow.
@self.app.callback(Output(‘update-div’,‘children’),
[
Input(‘submit’,‘n_clicks’)
],
[
State(‘ds-id’,‘value’),
State(‘day-id’,‘value’),
State(‘dropdown-business-id’, ‘value’),
])
def update(ncks,ds,days, tenant_id):
i just found there is a property: debounce
and it said:
If
True
, changes to input will be sent back to the Dash server only on enter or when losing focus. If it’sFalse
, it will sent the value back on every change.
should i change it to True?
and why use “State” doesn’t help in this case