A way to require dbc.Input to receive an updated value before triggering a callback while using debounce?

I have a large, dynamic number of dbc.Inputs (~200) that trigger a callback.
Their id’s use pattern matching callbacks.
The value entered in the input updates a SQL db.

The problem I am facing:
I need to have debounce=True so that every keystroke doesn’t trigger the callback.
However, having debounce=True also makes it so that if the Input is clicked into, and clicked out of without any changes being made, it still triggers the callback.

Is there any way to make it so the callback only triggers if the current value has been changed? I was hoping this could be done within the args of the input itself but did not see any args that would achieve this.

You could save the last callback value into a dcc.store, then compare it to make sure it’s changed.

I did think about something like this, but am not sure how this would work with a dynamic number of inputs. I believe I would first need to store the original values for all the Inputs with that pattern as a list, and then find the value being changed in that list?

You can use ctx to determine which output changed. Or even store it in the same manor, a dict, then compare it to the original to see which one changed.

1 Like