Skip to content

Commit

Permalink
refactor: enforce hiding dialog host element (#3597)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Mar 25, 2022
1 parent 07fcb38 commit 1d43cb2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dialog/src/vaadin-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class Dialog extends ThemePropertyMixin(ElementMixin(DialogDraggableMixin(Dialog
return html`
<style>
:host {
display: none;
display: none !important;
}
</style>
Expand Down
13 changes: 13 additions & 0 deletions packages/dialog/test/dialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ describe('vaadin-dialog', () => {
});
});

describe('host element', () => {
let dialog;

beforeEach(() => {
dialog = fixtureSync('<vaadin-dialog></vaadin-dialog>');
});

it('should enforce display: none to hide the host element', () => {
dialog.style.display = 'block';
expect(getComputedStyle(dialog).display).to.equal('none');
});
});

describe('opened', () => {
let dialog, backdrop, overlay;

Expand Down

0 comments on commit 1d43cb2

Please sign in to comment.