File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 44 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55 */
66import './vaadin-popover-overlay.js' ;
7- import { html , LitElement } from 'lit' ;
7+ import { css , html , LitElement } from 'lit' ;
88import { ifDefined } from 'lit/directives/if-defined.js' ;
99import {
1010 getDeepActiveElement ,
@@ -190,6 +190,14 @@ class Popover extends PopoverPositionMixin(
190190 return 'vaadin-popover' ;
191191 }
192192
193+ static get styles ( ) {
194+ return css `
195+ :host {
196+ display: none !important;
197+ }
198+ ` ;
199+ }
200+
193201 static get properties ( ) {
194202 return {
195203 /**
Original file line number Diff line number Diff line change @@ -29,6 +29,17 @@ describe('popover', () => {
2929 } ) ;
3030 } ) ;
3131
32+ describe ( 'host element' , ( ) => {
33+ it ( 'should set display: none on the host element by default' , ( ) => {
34+ expect ( getComputedStyle ( popover ) . display ) . to . equal ( 'none' ) ;
35+ } ) ;
36+
37+ it ( 'should enforce display: none to hide the host element' , ( ) => {
38+ popover . style . display = 'block' ;
39+ expect ( getComputedStyle ( popover ) . display ) . to . equal ( 'none' ) ;
40+ } ) ;
41+ } ) ;
42+
3243 describe ( 'renderer' , ( ) => {
3344 let renderer ;
3445
You can’t perform that action at this time.
0 commit comments