From e6f520ca451d10ab4704b52da1a519891c572736 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Wed, 25 May 2022 12:05:31 -0500 Subject: [PATCH] Eable visual loading state for list search --- components/search-stork.vue | 44 +++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/components/search-stork.vue b/components/search-stork.vue index b68abe1..40b18fe 100644 --- a/components/search-stork.vue +++ b/components/search-stork.vue @@ -25,7 +25,7 @@ type="search" placeholder="Type to Search" autocomplete="off" - @keyup="queryResults(query); scrollInputToTop()" + @keyup="handleSearchInput" >
@@ -75,6 +75,9 @@ :key="`listings-chunk-${i}`" class="listings-container divide-y divide-gray-700" > +
  • { return { @@ -484,8 +496,18 @@ export default { } }) - console.log('storkQuery.results', storkQuery.results) - } + // Switch from loading state and reveal the results + this.waitingForQuery = false + + // console.log('this.listingsResults', this.listingsResults) + }, + + handleSearchInput ( event ) { + const inputValue = event.target.value + + this.scrollInputToTop() + this.queryResults( inputValue ) + }, } }