Skip to content

add debounce to Dropdown#3637

Open
AnnMarieW wants to merge 9 commits intoplotly:devfrom
AnnMarieW:add-debounce-to-dropdown
Open

add debounce to Dropdown#3637
AnnMarieW wants to merge 9 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?

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)

1 participant