Skip to content

Commit 3a3a9ec

Browse files
authored
fix: use position: absolute for the split-layout handle (#10219)
1 parent a70260a commit 3a3a9ec

File tree

5 files changed

+62
-24
lines changed

5 files changed

+62
-24
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const splitLayoutStyles = css`
6868
width: var(--_handle-size);
6969
height: var(--_handle-target-size);
7070
max-height: 50%;
71-
position: relative;
71+
position: absolute;
7272
}
7373
7474
:host([orientation='vertical']) [part='handle'] {
3.62 KB
Loading

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,19 @@ import '../../../src/vaadin-split-layout.js';
66
describe('split-layout', () => {
77
let element;
88

9-
beforeEach(() => {
10-
element = fixtureSync(`
11-
<vaadin-split-layout style="width: 200px; height: 100px">
12-
<div></div>
13-
<div></div>
14-
</vaadin-split-layout>
15-
`);
16-
});
17-
189
afterEach(async () => {
1910
await resetMouse();
2011
});
2112

2213
['horizontal', 'vertical'].forEach((orientation) => {
2314
describe(orientation, () => {
2415
beforeEach(() => {
25-
element.orientation = orientation;
16+
element = fixtureSync(`
17+
<vaadin-split-layout orientation="${orientation}" style="width: 200px; height: 100px">
18+
<div></div>
19+
<div></div>
20+
</vaadin-split-layout>
21+
`);
2622
});
2723

2824
it(orientation, async () => {
@@ -41,4 +37,24 @@ describe('split-layout', () => {
4137
});
4238
});
4339
});
40+
41+
describe('nested', () => {
42+
beforeEach(() => {
43+
element = fixtureSync(`
44+
<vaadin-split-layout orientation="vertical" style="height: 500px">
45+
<vaadin-split-layout slot="primary" orientation="horizontal">
46+
<span slot="primary">Foo</span>
47+
<span slot="secondary">Bar</span>
48+
</vaadin-split-layout>>
49+
<div slot="secondary">
50+
Baz
51+
</div>
52+
</vaadin-split-layout>
53+
`);
54+
});
55+
56+
it('horizontal', async () => {
57+
await visualDiff(element, 'nested');
58+
});
59+
});
4460
});
3.64 KB
Loading

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

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,43 @@ import '../../../vaadin-split-layout.js';
77
describe('split-layout', () => {
88
let element;
99

10-
beforeEach(() => {
11-
element = fixtureSync(`
12-
<vaadin-split-layout style="width: 200px; height: 100px">
13-
<div></div>
14-
<div></div>
15-
</vaadin-split-layout>
16-
`);
17-
});
10+
describe('basic', () => {
11+
beforeEach(() => {
12+
element = fixtureSync(`
13+
<vaadin-split-layout style="width: 200px; height: 100px">
14+
<div></div>
15+
<div></div>
16+
</vaadin-split-layout>
17+
`);
18+
});
19+
20+
it('horizontal', async () => {
21+
await visualDiff(element, 'horizontal');
22+
});
1823

19-
it('horizontal', async () => {
20-
await visualDiff(element, 'horizontal');
24+
it('vertical', async () => {
25+
element.orientation = 'vertical';
26+
await visualDiff(element, 'vertical');
27+
});
2128
});
2229

23-
it('vertical', async () => {
24-
element.orientation = 'vertical';
25-
await visualDiff(element, 'vertical');
30+
describe('nested', () => {
31+
beforeEach(() => {
32+
element = fixtureSync(`
33+
<vaadin-split-layout orientation="vertical" style="height: 500px">
34+
<vaadin-split-layout slot="primary" orientation="horizontal">
35+
<span slot="primary">Foo</span>
36+
<span slot="secondary">Bar</span>
37+
</vaadin-split-layout>>
38+
<div slot="secondary">
39+
Baz
40+
</div>
41+
</vaadin-split-layout>
42+
`);
43+
});
44+
45+
it('horizontal', async () => {
46+
await visualDiff(element, 'nested');
47+
});
2648
});
2749
});

0 commit comments

Comments
 (0)