Skip to content

Commit 1d43cb2

Browse files
authored
refactor: enforce hiding dialog host element (#3597)
1 parent 07fcb38 commit 1d43cb2

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎packages/dialog/src/vaadin-dialog.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
175175
return html`
176176
<style>
177177
:host {
178-
display: none;
178+
display: none !important;
179179
}
180180
</style>
181181

‎packages/dialog/test/dialog.test.js‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ describe('vaadin-dialog', () => {
4545
});
4646
});
4747

48+
describe('host element', () => {
49+
let dialog;
50+
51+
beforeEach(() => {
52+
dialog = fixtureSync('<vaadin-dialog></vaadin-dialog>');
53+
});
54+
55+
it('should enforce display: none to hide the host element', () => {
56+
dialog.style.display = 'block';
57+
expect(getComputedStyle(dialog).display).to.equal('none');
58+
});
59+
});
60+
4861
describe('opened', () => {
4962
let dialog, backdrop, overlay;
5063

0 commit comments

Comments
 (0)