Skip to content

Commit d02e932

Browse files
vaadin-botugur-vaadinjouni
authored
fix: set overflow: clip on the split layout content elements (#11296) (#11299)
Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com> Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
1 parent 7cb8551 commit d02e932

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
lines changed

dev/split-layout.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
.second {
2424
/* Force the natural width of both containers to be equal */
2525
font-family: monospace;
26-
contain: paint;
2726
}
2827
</style>
2928
</head>

packages/split-layout/src/styles/vaadin-split-layout-base-styles.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export const splitLayoutStyles = css`
2626
min-height: 0;
2727
}
2828
29+
::slotted(:not(vaadin-split-layout)) {
30+
overflow: clip;
31+
}
32+
2933
[part='splitter'] {
3034
--_splitter-size: var(--vaadin-split-layout-splitter-size, 8px);
3135
--_splitter-target-size: var(--vaadin-split-layout-splitter-target-size, 8px);
492 Bytes
Loading
686 Bytes
Loading

packages/split-layout/test/visual/base/split-layout.test.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,36 @@ describe('split-layout', () => {
3838
});
3939
});
4040

41+
describe('overflow', () => {
42+
it('horizontal', async () => {
43+
element = fixtureSync(`
44+
<vaadin-split-layout style="width: 300px; height: 100px">
45+
<div>
46+
<div style="min-width: 400px; height: 50px; background: #ddd"></div>
47+
</div>
48+
<div></div>
49+
</vaadin-split-layout>
50+
`);
51+
// Shrink primary panel smaller than its content
52+
element.querySelector('div[slot="primary"], div:first-child').style.flex = '1 1 80px';
53+
await visualDiff(element, 'overflow-horizontal');
54+
});
55+
56+
it('vertical', async () => {
57+
element = fixtureSync(`
58+
<vaadin-split-layout orientation="vertical" style="width: 200px; height: 200px">
59+
<div>
60+
<div style="min-height: 400px; background: #ddd"></div>
61+
</div>
62+
<div></div>
63+
</vaadin-split-layout>
64+
`);
65+
// Shrink primary panel smaller than its content
66+
element.querySelector('div[slot="primary"], div:first-child').style.flex = '1 1 60px';
67+
await visualDiff(element, 'overflow-vertical');
68+
});
69+
});
70+
4171
describe('nested', () => {
4272
beforeEach(() => {
4373
element = fixtureSync(`

0 commit comments

Comments
 (0)