Pattern-matched Input does not trigger callback

I am having a problem with pattern-matched inputs not triggering a callback in my app.

To investigate, I created a file in the same folder and used the exact code from the ToDo app on the Pattern-Matching-Callbacks man page, here.

I modified the edit_list def to output some print statements as soon as it is called, and that worked fine.

I then swapped this Input line:

Input("add", "n_clicks"),

to this:

Input({"type": "add", "index": ALL}, "n_clicks"),

and immediately saw the same problem that I am experiencing - the callback was not called. Clicking the add button now does nothing. Here is the full modified callback (the rest of the code is identical to the original To-Do example):

        Output("list-container", "children"),
        Output("new-item", "value")
        Input({"type": "add", "index": ALL}, "n_clicks"),
        Input("new-item", "n_submit"),
        Input("clear-done", "n_clicks")
        State("new-item", "value"),
        State({"index": ALL}, "children"),
        State({"index": ALL, "type": "done"}, "value")
def edit_list(add, add2, clear, new_item, items, items_done):
    triggered = [t["prop_id"] for t in dash.callback_context.triggered]
    print('triggered: ', triggered)
    print('items_done: ', items_done)
    print('items: ', items)
    adding = len([1 for i in triggered if i in ("add.n_clicks", "new-item.n_submit")])
    ... etc (no further changes) ...

My requirements.txt file (note that the imports in remain the same as in the original ToDo app):


I’m running into this same issue. Has anybody found a fix yet?

Hello @Elliott,

Could you please provide your code so that we can try to emulate on our machines?

Hi @jinnyzor, sorry I assumed that the above example would suffice. Let me work on setting up a MWE.

@jinnyzor thanks again for the reply. I ended up getting past the problem using the solution here.

Ooo. Ok. Nice.

Yeah. Click data because technically it’s not changing wouldn’t trigger a change prop.


For this, is there a timestamp for the clickData that you could use to trigger it?

Unfortunately no. I was thinking the n_clicks would have been useful, as I have used it before to get an element to refresh, but for some reason, the callback doesn’t fire when using n_clicks in a pattern-matched input in this particular case.

Hmm. Ok.

I think I will encounter this issue today with something I am working on.