Fix ResizeObserver loop error (#902)
This commit is contained in:
parent
6208ead040
commit
ab518f51fb
@ -76,7 +76,6 @@ export class Combobox extends LitElement {
|
|||||||
<sl-popup
|
<sl-popup
|
||||||
placement="bottom-start"
|
placement="bottom-start"
|
||||||
shift
|
shift
|
||||||
sync="width"
|
|
||||||
strategy="fixed"
|
strategy="fixed"
|
||||||
?active=${this.isActive}
|
?active=${this.isActive}
|
||||||
@keydown=${this.onKeydown}
|
@keydown=${this.onKeydown}
|
||||||
@ -147,6 +146,16 @@ export class Combobox extends LitElement {
|
|||||||
private async openDropdown() {
|
private async openDropdown() {
|
||||||
this.isActive = true;
|
this.isActive = true;
|
||||||
await this.combobox?.updateComplete;
|
await this.combobox?.updateComplete;
|
||||||
|
|
||||||
|
// Manually sync dropdown width instead of using `sync="width"`
|
||||||
|
// to get around ResizeObserver loop error
|
||||||
|
if (this.anchor?.length && this.dropdown) {
|
||||||
|
const anchorWidth = this.anchor[0].clientWidth;
|
||||||
|
if (anchorWidth) {
|
||||||
|
this.dropdown.style.width = `${anchorWidth}px`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.dropdown?.classList.add("animateShow");
|
this.dropdown?.classList.add("animateShow");
|
||||||
this.dropdown?.classList.remove("hidden");
|
this.dropdown?.classList.remove("hidden");
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,7 @@ export class CrawlsList extends LiteElement {
|
|||||||
<div class="text-neutral-500 mx-2">${msg("View:")}</div>
|
<div class="text-neutral-500 mx-2">${msg("View:")}</div>
|
||||||
<sl-select
|
<sl-select
|
||||||
id="stateSelect"
|
id="stateSelect"
|
||||||
class="flex-1 md:min-w-[14.5rem]"
|
class="flex-1 md:w-[14.5rem]"
|
||||||
size="small"
|
size="small"
|
||||||
pill
|
pill
|
||||||
multiple
|
multiple
|
||||||
@ -321,7 +321,7 @@ export class CrawlsList extends LiteElement {
|
|||||||
</div>
|
</div>
|
||||||
<div class="grow flex">
|
<div class="grow flex">
|
||||||
<sl-select
|
<sl-select
|
||||||
class="flex-1 md:min-w-[9.2rem]"
|
class="flex-1 md:w-[9.2rem]"
|
||||||
size="small"
|
size="small"
|
||||||
pill
|
pill
|
||||||
value=${this.orderBy.field}
|
value=${this.orderBy.field}
|
||||||
|
Loading…
Reference in New Issue
Block a user