Comments (10)
I wonder if this is caused by fade
or delay
? I'm trying to find the code that updates the is_open
erroneously... @tcbegley can you help me?
Is it here?
dash-bootstrap-components/src/private/Overlay.js
Lines 62 to 80 in 71b3070
If it's delay, setting delay={"show": 0, "hide": 0},
should be a reasonable workaround.
from dash-bootstrap-components.
Hi @FRosner,
Thanks for reporting this and for providing so much detail and a minimal reproduction.
The issue is indeed in hideWithDelay
. When the "close" even happens, we call setProps({is_open: false})
with a delay. In this case in the intervening time the component is unmounted. That means when Dash tries to update the prop the component no longer exists.
I think the fix here will be to either:
- modify the timeout so that the call to
setProps
only happens if the component hasn't been unmounted - cancel outstanding timeouts when the component unmounts
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.
from dash-bootstrap-components.
I'll see what I can do.
Thank you so much!
from dash-bootstrap-components.
I think the fix here will be to either:
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?
from dash-bootstrap-components.
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.
from dash-bootstrap-components.
Thanks! I am trying the workaround of setting hide delay to 0
in the meantime. I'd also take a stab at it but last time I used react is 5 years ago :D
from dash-bootstrap-components.
Related Issues (20)
- Support tooltips without IDs HOT 3
- [Bug] Console warning on dbc.Tooltip component HOT 3
- dbc.Tabs not showing all tabs in expanded mode in 1.4.1 HOT 1
- Is there a way to use an icon as a label in a dbc.Tab element? HOT 2
- Alert component breaks multi-page navigation HOT 1
- Dash & XLwings. Attempting to pre-load Excel before Dash callback to save load time. HOT 3
- dbc.Input no type = 'file' HOT 6
- dbc.TextArea n_submit should not increment for Shift+Enter? HOT 3
- Consider Supporting Hyperlinks in Carousel Images HOT 6
- Dropdown presentation in data table doesn't work HOT 1
- Keyword argument for value OR placeholder HOT 2
- BUG: max doesn't work on nested progress bar HOT 3
- Docs app not working with Dash 2.14.0 HOT 3
- Allow icons and html in `dbc.AccordionItem()` title HOT 3
- Remove migration guide in docs
- selected attribute for dbc.Select HOT 1
- `dbc.Checklist` does not accept `label` as `list[Component]` like `dcc.Checklist` does HOT 3
- dash_bootstrap_components version versus python version HOT 5
- Nested tabs in `Offcanvas` component trigger scroll up event on tab change HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dash-bootstrap-components.