Skip to content

Commit 9ac5abe

Browse files
authored
fix: enforce tabsheet panels to be hidden (#10002)
1 parent 8c529b8 commit 9ac5abe

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export const tabSheetStyles = [
3838
min-width: 128px;
3939
}
4040
41+
::slotted([hidden]) {
42+
display: none !important;
43+
}
44+
4145
[part='content'] {
4246
position: relative;
4347
flex: 1;

packages/tabsheet/test/tabsheet.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ describe('tabsheet', () => {
161161
expect(getPanels()[2].hidden).to.be.true;
162162
});
163163

164+
it('should override display style when panel is hidden', async () => {
165+
tabsheet.selected = 1;
166+
await nextFrame();
167+
const panel2 = getPanels()[2];
168+
panel2.style.display = 'contents';
169+
const display = getComputedStyle(panel2).display;
170+
expect(display).to.equal('none');
171+
});
172+
164173
it('should bind dynamically added tab and panel', async () => {
165174
// Create a new tab and panel
166175
const tab = document.createElement('vaadin-tab');

packages/vaadin-lumo-styles/src/components/tabsheet.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
margin: calc(var(--lumo-space-xs) * -1) calc(var(--lumo-space-s) * -1);
3434
}
3535

36+
::slotted([hidden]) {
37+
display: none !important;
38+
}
39+
3640
[part='content'] {
3741
position: relative;
3842
flex: 1;

0 commit comments

Comments
 (0)