Hello,
In a Dash 2.0.0 app I have a callback that needs to respond to two different inputs:
- A single button being pressed
- Any of a number of buttons that are dynamically generated like so:
dbc.Button(
f"Plot {plot_id} ✖️",
id={"type": "remove-button", "index": plot_id},
)
for plot_id in plot_ids
I’ve given my callback this signature:
@app.callback(
Output("aggregate-tab", "children"),
Input("add-button", "n_clicks"),
Input({"type": "remove-button", "index": ALL}, "id"),
)
def add_plot_to_combined_plot(n_clicks, id)
My problem is that the callback works fine for the single button but when I click on any of the dynamically generated buttons, the callback is not invoked.
If I remove the single button Output()
from the callback, the callback fires just fine for the dynamically generated buttons.
Why then does the callback fail to work for the Output()
with the pattern matching?
Thanks,
urig