Skip to content

Commit 762370d

Browse files
authored
fix: reflect popover opened property to attribute (#9967)
1 parent 07c143b commit 762370d

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

packages/popover/src/vaadin-popover.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ class Popover extends PopoverPositionMixin(
311311
type: Boolean,
312312
value: false,
313313
notify: true,
314+
reflectToAttribute: true,
314315
observer: '__openedChanged',
315316
},
316317

packages/popover/test/basic.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ describe('popover', () => {
3232
it('should set display: contents on the host element by default', () => {
3333
expect(getComputedStyle(popover).display).to.equal('contents');
3434
});
35+
36+
it('should reflect opened property to attribute', async () => {
37+
popover.opened = true;
38+
await nextUpdate(popover);
39+
expect(popover.hasAttribute('opened')).to.be.true;
40+
41+
popover.opened = false;
42+
await nextUpdate(popover);
43+
expect(popover.hasAttribute('opened')).to.be.false;
44+
});
3545
});
3646

3747
describe('renderer', () => {

packages/popover/test/dom/__snapshots__/popover.test.snap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ snapshots["vaadin-popover host"] =
55
`<vaadin-popover
66
id="vaadin-popover-0"
77
modeless=""
8+
opened=""
89
role="dialog"
910
>
1011
content

0 commit comments

Comments
 (0)