Skip to content

[BUG] 4.1.0 dropdown search crash #3707

@ColinGeukes

Description

@ColinGeukes

Describe your context

dash                 4.1.0

Describe the bug

When typing a subset search pattern that matches a large subset of the items, then it causes the dropdown to crash

Expected behavior

The filtered items should be visible instead of a crash

Minimal Working Code Example

from dash import Dash, dcc, html

app = Dash(__name__)

options = [
    {"label": html.Div(["Item", html.Span(f"#{i}")]),
     "value": f"item_{i}",
     "search": f"item_#{i}"}
    for i in range(1, 5001)
]

app.layout = html.Div(
    [
        html.H3("Dropdown that crashes after typing a number"),
        dcc.Dropdown(
            id="big-dropdown",
            options=options,
            value="item_1",
            placeholder="Select an item",
            searchable=True,
            clearable=True,
            style={"width": "500px"},

        ),
    ],
)

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

If you type a number in the dropdown search bar then the application crashes and the search input is frozen

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions