Skip to content

Commit 4495f36

Browse files
DiegoCardosoclaude
andauthored
fix: remove flex: 1 from scroller base styles to respect explicit height (#11373)
Since v25.0, setting an explicit height on vaadin-scroller inside a flex container had no effect because flex: 1 on :host forced the scroller to grow and fill available space. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 01703d4 commit 4495f36

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

packages/scroller/src/styles/vaadin-scroller-base-styles.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const scrollerStyles = css`
1717
display: block;
1818
overflow: auto;
1919
outline: none;
20-
flex: 1;
2120
box-sizing: border-box;
2221
padding: var(--vaadin-scroller-padding-block) var(--vaadin-scroller-padding-inline);
2322
}

packages/scroller/test/scroller.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,26 @@ describe('vaadin-scroller', () => {
148148
});
149149
});
150150

151+
describe('explicit height in flex container', () => {
152+
let container;
153+
154+
beforeEach(async () => {
155+
container = fixtureSync(`
156+
<div style="display: flex; flex-direction: column; height: 500px;">
157+
<vaadin-scroller style="height: 200px;">
158+
<div>Content</div>
159+
</vaadin-scroller>
160+
</div>
161+
`);
162+
scroller = container.querySelector('vaadin-scroller');
163+
await nextRender();
164+
});
165+
166+
it('should respect explicit height when inside a flex container', () => {
167+
expect(scroller.offsetHeight).to.equal(200);
168+
});
169+
});
170+
151171
describe('full height content', () => {
152172
let container;
153173

0 commit comments

Comments
 (0)