Skip to content

add debounce to Dropdown#3637

Merged
T4rk1n merged 10 commits intoplotly:devfrom
AnnMarieW:add-debounce-to-dropdown
Mar 6, 2026
Merged

add debounce to Dropdown#3637
T4rk1n merged 10 commits intoplotly:devfrom
AnnMarieW:add-debounce-to-dropdown

Conversation

@AnnMarieW
Copy link
Collaborator

@AnnMarieW AnnMarieW commented Mar 2, 2026

closes #3620

This PR adds an optional debounce (boolean) prop to the Dropdown

When debounce=True, changes to selected values will be sent back to the Dash server only when dropdown menu closes.

from dash import Dash, dcc, html, Input, Output,callback

app = Dash()
app.layout = html.Div([
    html.Div(id='dd-output-container'),
    dcc.Dropdown(
        ['NYC', 'MTL', 'SF'],
        'NYC', id='demo-dropdown',
        debounce=True,
        closeOnSelect=False,
        multi=True),
])


@callback(
    Output('dd-output-container', 'children'),
    Input('demo-dropdown', 'value')
)
def update_output(value):
    return f'You have selected {value}'


if __name__ == '__main__':
    app.run(debug=True)

@AnnMarieW AnnMarieW marked this pull request as ready for review March 3, 2026 01:23
@AnnMarieW
Copy link
Collaborator Author

The two failed tests in dcc-312 are for date pickers which is unrelated to this PR. Flakey tests?

Copy link
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@T4rk1n T4rk1n merged commit 9ab7970 into plotly:dev Mar 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] debounce for dcc.Dropdown(multi=True)

2 participants