-
Notifications
You must be signed in to change notification settings - Fork 87
fix: prevent vaadin-chart from expanding parent containers #10366
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
base: main
Are you sure you want to change the base?
Conversation
| const { height } = this.$.wrapper.style; | ||
| this.$.wrapper.style.height = ''; | ||
| this.configuration.setSize(null, null, false); | ||
| this.$.wrapper.style.height = height; |
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.
Cleaned up code that was attempting to reset chart size on reattachment, which is no longer needed with the new positioning approach.
|
Not sure if we have idential test pages, but this is how the Kapture.2025-10-24.at.11.42.24.mp4 |
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.
The changes look good to me. I did not notice any issues with the changes in position.
Chart Height Behavior in Dashboard WidgetsSeems that in ✅ Expected Behavior
chart-in-widget-after.mp4⚙️ Behavior in
|





Description
Fixes #10316
Prevents
<vaadin-chart>from expanding its parent container. The issue occurred in flex layouts where the chart's intrinsic size would cause the parent to grow beyond its intended dimensions.Changes
Positioning strategy: Applied
position: relativeto the wrapper andposition: absoluteto the internal chart element. This prevents the chart's intrinsic size from contributing to the parent's size calculation.Intrinsic sizing: Added logic to apply
min-height/min-widthto the wrapper when it would otherwise collapse to ≤1px. This ensures charts maintain their default size when no explicit dimensions are provided by the container.Verification
The PR branch includes temporary dev pages (removed in one of the later commits) that can be used to verify the fixes:
dev/highcharts.html- Reproduces the original issue from Charts ends up in a reflow loop #10316dev/chart-dashboard.html- Tests charts in dashboard widgets (requiresyarn start:lumoto see the dashboard-related bug)dev/highcharts-parent-sizing.html- Tests parent sizing contributionsdev/highcharts-zindex.html- Tests z-index stacking behaviorPotential Concerns
These concerns have been mitigated by:
<vaadin-chart>element itself) remains in normal flowType of change
Bugfix