Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dash DCC.Dropdown using Dynamic Options, nested within dcc.Loading returns empty list #2422

Closed
urifeigin opened this issue Feb 13, 2023 · 1 comment

Comments

@urifeigin
Copy link

dash                      2.7.1
dash-ag-grid              0.0.1
dash-bootstrap-components 1.3.0
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-table                5.0.0
- OS: Windows 11
- Browser: Edge
- Version 110.0.1587.41 

Describe the bug

Using Dash DCC.Dropdown using Dynamic Options, nested within dcc.Loading returns empty list.

Upon inspection the callback fires twice, once retuning the options list for the dropdown as expected and once returns and empty list even though prevent update is used. This happens on any single key pressed in the search box of the dropdown. removing the DCC.Dropdown from being nested in dcc.loading resolves the issue.

The code example used is exactly as in the dash documentation, except for the dcc.loading wrapper.

                                                        dcc.Loading(
                                                            [
                                                                dcc.Dropdown(
                                                                    id="add_new_wave_modal_entity_sel_id",
                                                                ),
                                                            ]
                                                        ),

@callback(
Output("add_new_wave_modal_entity_sel_id", "options"),
Input("add_new_wave_modal_entity_sel_id", "search_value"),
)
def update_options(search_value):
if not search_value:
raise PreventUpdate
return [o for o in glb.wave_entity_signals_dd_options if search_value in o["label"]]

Expected behavior

The dcc.dropdown list will populate according to the typed filter on the fly. the spinner of the dcc.loading will appear if the list takes time to appear.

Screenshots
Screenshot 2023-02-13 020120

@Coding-with-Adam
Copy link

closed by #2760

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

No branches or pull requests

2 participants