Skip to content

Commit 22eb91d

Browse files
authored
fix: do not throw when setting opened attribute (#4221)
1 parent 6125fcb commit 22eb91d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/combo-box/src/vaadin-combo-box-mixin.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ export const ComboBoxMixin = (subclass) =>
438438
};
439439

440440
// Ensure the scroller is rendered
441-
if (!this.opened) {
442-
overlay.requestContentUpdate();
443-
}
441+
overlay.requestContentUpdate();
444442

445443
const scroller = overlay.querySelector(scrollerTag);
446444

‎packages/combo-box/test/basic.test.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@ describe('value set before attach', () => {
521521

522522
describe('pre-opened', () => {
523523
it('should not throw error when adding a pre-opened combo-box', () => {
524+
expect(() => fixtureSync(`<vaadin-combo-box opened></vaadin-combo-box>`)).to.not.throw(Error);
525+
});
526+
527+
it('should not throw error when adding a pre-opened combo-box with items', () => {
524528
expect(() => fixtureSync(`<vaadin-combo-box opened items="[0]"></vaadin-combo-box>`)).to.not.throw(Error);
525529
});
526530

0 commit comments

Comments
 (0)