Skip to content

Commit 84ce729

Browse files
feat(js): don't append panel on initial loading
1 parent 59dc31b commit 84ce729

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/autocomplete-js/src/render.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ export function render<TItem extends BaseItem>(
5959
return () => {};
6060
}
6161

62-
if (!panelRoot.contains(panel)) {
62+
// We add the panel element to the DOM when it's not yet appended and that the
63+
// items are fetched.
64+
if (!panelRoot.contains(panel) && state.status !== 'loading') {
6365
panelRoot.appendChild(panel);
6466
}
6567

0 commit comments

Comments
 (0)