Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] running does not support wildcards in ids #2863

Closed
tlauli opened this issue May 20, 2024 · 1 comment · Fixed by #2876
Closed

[BUG] running does not support wildcards in ids #2863

tlauli opened this issue May 20, 2024 · 1 comment · Fixed by #2876
Assignees
Labels
bug something broken sev-2 serious problem

Comments

@tlauli
Copy link

tlauli commented May 20, 2024

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                                     2.17.0
dash-core-components                     2.0.0
dash-html-components                     2.0.0
dash-table                               5.0.0
dash-bootstrap-components                1.6.0

Describe the bug

Using wildcards in ids for Outputs in the running kwarg does leads to itempath is undefined error.

Expected behavior

Wildcards are properly resolved and matching components are updated while the callback is running.

MVE

from time import sleep

import dash_bootstrap_components as dbc
from dash import MATCH, Input, Output, callback

layout = [
    dbc.Button(
        "Test1",
        id={"component": "button", "index": "1"},
    ),
    dbc.Button(
        "Test2",
        id={"component": "button", "index": "2"},
    ),
]


@callback(
    Output({"component": "button", "index": MATCH}, "color"),
    Input({"component": "button", "index": MATCH}, "n_clicks"),
    running=[
        (Output({"component": "button", "index": MATCH}, "children"), "running", "finished"),
    ],
    prevent_initial_call=True,
)
def test(_) -> str:
    sleep(3)
    return "warning"
@Coding-with-Adam
Copy link
Contributor

The main issue here is that the MATCH doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken sev-2 serious problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants