-
Notifications
You must be signed in to change notification settings - Fork 271
fix: charts rerender with zero-height during tab switch #703
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/superset/superset-ui/kc981xmfi |
Codecov Report
@@ Coverage Diff @@
## master #703 +/- ##
=======================================
Coverage 24.21% 24.22%
=======================================
Files 338 338
Lines 7607 7608 +1
Branches 924 925 +1
=======================================
+ Hits 1842 1843 +1
Misses 5692 5692
Partials 73 73
Continue to review full report at Codecov.
|
Nice @ktmud 👍 Do you know if this problem specific to Bootstrap, and would the corresponding AntD Tab component work correctly without a similar fix? |
@villebro I haven't tested. It depends on how they implemented the transition animation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for catching/fixing this!
@ktmud feel free to merge and deploy at will so we can bump the package in |
🐛 Bug Fix
Some charts rely on the dimension of mounted chart elements (
node.clientWidth
andnode.clientHeight
) to adjust layout, but both values are zero when Bootstrap tabs are still animating. The unfortunate timing leads to some charts unable to re-render when switching tabs after applying filters (see apache/superset#10349 ).Ideally we should fix the Tabs component and only re-render charts when animation finishes but I was not able to find a clean way to do that, so fixing the known broken charts instead.
Test Plan
Manual testing