Skip to content

Commit 04b3b12

Browse files
authored
fix: ensure floating UI has loaded before using its functions (#560)
1 parent b881d57 commit 04b3b12

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.changeset/wide-symbols-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ebay/ebayui-core": patch
3+
---
4+
5+
Fix floating UI loading bug

packages/ebayui-core/src/common/dropdown/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export class DropdownUtil {
7272
}
7373

7474
update() {
75+
if (!this.loaded) return;
7576
const middleware = [] as Middleware[];
7677
middleware.push(this.offset(this.options.offset ?? 4));
7778
if (this.options.flip) {

packages/ebayui-core/src/components/components/ebay-tooltip-base/component-browser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ class TooltipBase extends Marko.Component<Input, State> {
171171
}
172172

173173
updateTip() {
174+
if (!this.state.loaded) return;
174175
this.computePosition(
175176
this.hostEl as HTMLElement,
176177
this.overlayEl as HTMLElement,

0 commit comments

Comments
 (0)