You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dropdown reordering options by value on search #2667
dash 2.14.0, 2.9.2
Windows 10
Chrome 118.0.5993.71
Description
When entering a search_value in dcc.Dropdown, the matching options are ordered by value, ignoring the original option order. This behavior only happens when the option values are integers or integer-like strings (i.e. 3 or "3" or 3.0 but not "03" or 3.1).
Expected behavior
The original order of the dropdown options should be preserved when searching.
Example
Searching "*" in the dropdown below returns all three results, but the options are reordered by ascending value.
Attempted fixes
I expected Dynamic Dropdowns to give control over custom search behavior. However, even when a particular order of options is specified, the matching options are re-ordered by ascending value.
# This callback should overwrite the built-in search behavior.# Instead, the filtered options are sorted by ascending value.@app.callback(Output("my-dropdown", "options"),Input("my-dropdown", "search_value"),)defcustom_search_sort(search_value):
ifnotsearch_value:
raisePreventUpdatereturn [oforoinmy_optionsifsearch_valueinstr(o)]
Activity
[-][BUG] Dropdown reordering options by value on search[/-][+]Dropdown reordering options by value on search[/+]Fix plotly#2989, plotly#2667: Add search_order prop to control dropdo…
AnnMarieW commentedon Apr 12, 2026
Fixed in PR #3680