plotly / plotly/dash

[BUG] Clientside callbacks with the same input and no outputs override each other

Aperta
#3,596 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@T4rk1n ci sta già lavorando.

Dal 4/2/2026.

Lingua principale
Python
Stelle
24.4k
Fork
2.3k
Merge medio
2g 7h
PR unite (30g)
13

Descrizione

Environment

pip list | grep dash output:

dash                      3.3.0
dash_ag_grid              33.3.3
dash-bootstrap-components 2.0.4
dash_cytoscape            1.0.2
  • OS: Ubuntu 22.04.5
  • Browser: Firefox 147.0.2

Bug description

See example code below. Clicking the button should show "one" and "two" in the developer console (I am not sure if there is a specified order in which they are expected to show up; however, I don't really mind as long as both callbacks get triggered).

However, instead only "two" is shown. It looks like the first clientside callback gets "overriden" somehow. This is not a problem when the callbacks have defined outputs.

There are some applications I have where it is useful for one component to trigger multiple clientside callbacks, so this bug does impact me (although it seems pretty straightforward to work around it).

Minimal example

#! /usr/bin/env python3
from dash import Dash, html, clientside_callback, Input

app = Dash()
app.layout = [
    html.Button("click me", id="testBtn"),
]

clientside_callback(
    """
    function(n_clicks) {
        console.log("one");
    }
    """,
    Input("testBtn", "n_clicks"),
    prevent_initial_call=True,
)

clientside_callback(
    """
    function(n_clicks) {
        console.log("two");
    }
    """,
    Input("testBtn", "n_clicks"),
    prevent_initial_call=True,
)

app.run(debug=True, port=8055)

Screen capture of the bug

Image

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.