-
Notifications
You must be signed in to change notification settings - Fork 223
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 1.5.0 inclusion of dash.DataTable and dbc.Modal breaks all callbacks #277
Comments
I found the following: When replacing the dash_bootstrap_components.Modal.is_open property with a simple dash_html_components.div.style property:
Everything works as expected => So no bug in dash, but in dash bootstrap components. |
probably related to plotly/dash#995 |
Still the same problem with Dash 1.6.0 |
Thanks for reporting this and for doing so in such detail. I don't fully understand the issue yet, but my best guess is that it's a combination of the lazy loading of JavaScript bundles added in Dash 1.5.0 (see here and here) and the fact that the modal contents are not in the page layout on load, toggling the I'm going to need a bit more time to properly understand the issue and figure out how / whether it can be fixed on the dash-bootstrap-components side, but for now here's a temporary workaround. Simply add a hidden empty def layout() -> html.Div:
...
hidden_table = html.Div(dt.DataTable(), style={"display": "none"})
layout = html.Div([build_node_settings_modal(), div1, div2, hidden_table])
return layout Testing that on my end it resolves things for now, even if it's slightly unsatisfactory. Let me know how you get on, and I'll look into a better fix. |
Indeed, this workaround also works in my large app. I would not understand why or how, but thanks for pointing this out! |
@tcbegley I just wanted to point out that I am encountering this bug without any use of the |
That's interesting, are you able to share a minimal example that reproduces the issue? If so it may be worth also raising an issue on the Plotly Dash repo. |
Thanks! I'll keep an eye on that and see if there's any action needed from us. |
Describe your context
We have a fairly complex app which was wonderfully working on Dash 1.4.0 and before. Now I updated to Dash 1.5.0 and subsequently to 1.5.1 and the fact of including a DataTable makes all callbacks not working anymore (even the clientside ones).
I managed to break it down to a minimal working example which exposes the error:
This does work (i.e. clicking on one of the "Settings" Buttons make a modal appear:
When I uncomment the dash_table part:
The callback won't fire anymore (and there is not even a callback related to the table!)
So no modal showing up
pip list | grep dash
belowif frontend related, tell us your Browser, Version and OS
Describe the bug
Having a DataTable in the layout breaks all callbacks, i.e callbacks are not firing at all anymore
Uncommenting the use of DataTable makes everything OK
Expected behavior
Callback working
The text was updated successfully, but these errors were encountered: