|
12 | 12 | import '@vaadin/split-layout'; |
13 | 13 |
|
14 | 14 | document.querySelectorAll('.first').forEach((el) => { |
15 | | - el.textContent = new Array(1000).fill('a').join(' '); |
| 15 | + el.innerHTML = `<div style="padding: 0.5rem">${new Array(420).fill('a').join(' ')}</div>`; |
16 | 16 | }); |
17 | 17 | document.querySelectorAll('.second').forEach((el) => { |
18 | | - el.textContent = new Array(1000).fill('b').join(' '); |
| 18 | + el.innerHTML = `<div style="padding: 0.5rem">${new Array(420).fill('b').join(' ')}</div>`; |
19 | 19 | }); |
20 | 20 | </script> |
21 | 21 |
|
22 | 22 | <style> |
23 | | - vaadin-split-layout { |
24 | | - display: inline-flex; |
25 | | - margin: 0 1rem 2rem 0; |
| 23 | + .first, |
| 24 | + .second { |
26 | 25 | /* Force the natural width of both containers to be equal */ |
27 | 26 | font-family: monospace; |
| 27 | + contain: paint; |
28 | 28 | } |
29 | 29 | </style> |
30 | 30 | </head> |
31 | 31 |
|
32 | 32 | <body> |
33 | 33 | <h2 class="heading">Default</h2> |
34 | | - <vaadin-split-layout style="width: 400px; height: 200px"> |
35 | | - <div class="first"></div> |
36 | | - <div class="second"></div> |
37 | | - </vaadin-split-layout> |
38 | | - <vaadin-split-layout style="width: 400px; height: 200px" orientation="vertical"> |
39 | | - <div class="first"></div> |
40 | | - <div class="second"></div> |
41 | | - </vaadin-split-layout> |
| 34 | + <p> |
| 35 | + These Split Layouts are wrapped in a div with <code>overflow: auto;</code>, but you shouldn't see a scrollbar even |
| 36 | + if you drag the splitters to the end. |
| 37 | + </p> |
| 38 | + <div style="width: fit-content; height: fit-content; overflow: auto"> |
| 39 | + <vaadin-split-layout style="width: 400px; height: 200px"> |
| 40 | + <vaadin-split-layout style="width: 400px; height: 200px" orientation="vertical"> |
| 41 | + <div class="first"></div> |
| 42 | + <div class="second"></div> |
| 43 | + </vaadin-split-layout> |
| 44 | + <vaadin-split-layout style="width: 400px; height: 200px" orientation="vertical"> |
| 45 | + <div class="first"></div> |
| 46 | + <div class="second"></div> |
| 47 | + </vaadin-split-layout> |
| 48 | + </vaadin-split-layout> |
| 49 | + </div> |
42 | 50 |
|
43 | 51 | <h2 class="heading">Small</h2> |
| 52 | + <p> |
| 53 | + The small variant shouldn't inherit to the nested Split Layouts. The first nested Split Layout uses the small |
| 54 | + variant explicitly. |
| 55 | + </p> |
44 | 56 | <vaadin-split-layout style="width: 400px; height: 200px" theme="small"> |
45 | | - <div class="first"></div> |
46 | | - <div class="second"></div> |
47 | | - </vaadin-split-layout> |
48 | | - <vaadin-split-layout style="width: 400px; height: 200px" orientation="vertical" theme="small"> |
49 | | - <div class="first"></div> |
50 | | - <div class="second"></div> |
51 | | - </vaadin-split-layout> |
52 | | - |
53 | | - <h2 class="heading">Minimal</h2> |
54 | | - <vaadin-split-layout style="width: 400px; height: 200px" theme="minimal"> |
55 | | - <div class="first"></div> |
56 | | - <div class="second"></div> |
57 | | - </vaadin-split-layout> |
58 | | - <vaadin-split-layout style="width: 400px; height: 200px" orientation="vertical" theme="minimal"> |
59 | | - <div class="first"></div> |
60 | | - <div class="second"></div> |
| 57 | + <vaadin-split-layout style="width: 400px; height: 200px" orientation="vertical" theme="small"> |
| 58 | + <div class="first"></div> |
| 59 | + <div class="second"></div> |
| 60 | + </vaadin-split-layout> |
| 61 | + <vaadin-split-layout style="width: 400px; height: 200px" orientation="vertical"> |
| 62 | + <div class="first"></div> |
| 63 | + <div class="second"></div> |
| 64 | + </vaadin-split-layout> |
61 | 65 | </vaadin-split-layout> |
62 | 66 | </body> |
63 | 67 | </html> |
0 commit comments