Skip to content

Commit

Permalink
feat(js): don't append panel on initial loading
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Dec 2, 2020
1 parent 59dc31b commit 84ce729
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/autocomplete-js/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export function render<TItem extends BaseItem>(
return () => {};
}

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

Expand Down

0 comments on commit 84ce729

Please sign in to comment.