simplify initial open behavior

This commit is contained in:
Cory LaViska
2022-08-09 16:01:13 -04:00
parent d6508a1262
commit 13ec55ba07

View File

@@ -105,13 +105,13 @@ export default class SlDropdown extends LitElement {
}
}
async firstUpdated() {
firstUpdated() {
this.panel.hidden = !this.open;
// If the dropdown is visible on init, update its position
if (this.open) {
await this.updateComplete;
this.popup.reposition();
this.addOpenListeners();
this.popup.active = true;
}
}