From b9a7570e3b5ab133eea89698833a52bcc5ebdb49 Mon Sep 17 00:00:00 2001 From: Jacob Mischka Date: Fri, 3 Mar 2023 14:45:42 -0600 Subject: [PATCH] Fetch initial io.search results asynchronously if not given This changes behavior in that an empty search bar is never shown anymore, we will immediately fetch data when the input renders. Closes T-605 --- src/examples/basic/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/examples/basic/index.ts b/src/examples/basic/index.ts index fbbc55b..d6b7c7d 100644 --- a/src/examples/basic/index.ts +++ b/src/examples/basic/index.ts @@ -406,6 +406,7 @@ const interval = new Interval({ const [r1, r2] = await io.group([ io.search('One', { onSearch: async query => fakeDb.find(query), + initialResults: await fakeDb.find('jo'), renderResult: result => ({ label: `${result.first_name} ${result.last_name}`, }),