-
Notifications
You must be signed in to change notification settings - Fork 220
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
Tooltip closing race condition with children change callback #997
Comments
I wonder if this is caused by Is it here? dash-bootstrap-components/src/private/Overlay.js Lines 62 to 80 in 71b3070
If it's delay, setting |
Hi @FRosner, Thanks for reporting this and for providing so much detail and a minimal reproduction. The issue is indeed in I think the fix here will be to either:
I think 2) is probably cleaner but looking over the code briefly might require a bit of refactoring. I'll see what I can do. |
Thank you so much! |
To me, 1 sounds preferrable, as it has limited side effects and makes it clearer when the function is passed to setTimeout that this is something to be aware of. Why do you think 2 is cleaner? |
Well the timeouts only make sense in the context of the component, so if the component no longer exists it seems neater to stop them from running at all rather than to run and do little / nothing. But tbh both options are similar so I'll take whatever solution is simpler to implement. I did have a go at getting this to work yesterday but it turned out to be fiddlier than expected. I might need to refresh some of my react knowledge and try again when I get a chance. |
Thanks! I am trying the workaround of setting hide delay to |
Small addition from my side: |
Hi @jonicohn Which version of dash-bootstrap-components are you using? It sounds like what you're describing could be related to this issue which should have been fixed in v1.4.2 |
Hi tcbegley, sorry, my bad. You are absolutely correct. 1.5.0 is working fine. |
Sorry this took some time, it took me a while to get my head around it. It's now fixed in the latest version.
|
#2.14.2
#1.5.0
What is happening?
In a dash SPA when opening a page with a dbc tooltip, then navigating to a new page, the page fails to render with
It's not specific to the SPA callback. I managed to reproduce it with a callback that upon clicking a button with a tooltip removes the button and the tooltip from the children of their parents.
See https://stackoverflow.com/questions/75175955/an-object-was-provided-as-children-instead-of-a-component-error-in-python-da for more details.
What should be happening?
The tooltip should be removed and the client side callback should not attempt to patch the non-existing tooltip component, effectively corrupting the children property.
Code
Error messages
The text was updated successfully, but these errors were encountered: