-
Notifications
You must be signed in to change notification settings - Fork 14k
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
fix(explore): double resize triggered #24886
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24886 +/- ##
==========================================
- Coverage 69.00% 69.00% -0.01%
==========================================
Files 1906 1906
Lines 74142 74120 -22
Branches 8208 8208
==========================================
- Hits 51160 51143 -17
+ Misses 20859 20854 -5
Partials 2123 2123
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@justinpark Could you check if we can remove the
|
superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
Outdated
Show resolved
Hide resolved
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. Thank you for the improvement @justinpark!
(cherry picked from commit 340bfd8)
SUMMARY
Since the chart container triggers the resize handler by both props and state, it often tends to trigger rendering twice.
This commit debounces the resize function to prevent accidental duplicate resize calls.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
after--double-resize.mov
after--double-resize-perf.mov
Before:
before--double-resize.mov
before--double-resize-perf.mov
TESTING INSTRUCTIONS
Go to dashboard and resize the window
ADDITIONAL INFORMATION