5757 class =" unified-search__form-reset icon-close"
5858 :aria-label =" t('core','Reset search')"
5959 value =" " >
60+
61+ <input v-if =" !!query && !isLoading && !enableLiveSearch"
62+ type =" submit"
63+ class =" unified-search__form-submit icon-confirm"
64+ :aria-label =" t('core','Start search')"
65+ value =" " >
6066 </form >
6167
6268 <!-- Search filters -->
7682 <SearchResultPlaceholders v-if =" isLoading" />
7783
7884 <EmptyContent v-else-if =" isValidQuery" icon =" icon-search" >
79- <Highlight :text =" t('core', 'No results for {query}', { query })" :search =" query" />
85+ <Highlight v-if =" triggered" :text =" t('core', 'No results for {query}', { query })" :search =" query" />
86+ <div v-else >
87+ {{ t('core', 'Press enter to start searching') }}
88+ </div >
8089 </EmptyContent >
8190
8291 <EmptyContent v-else-if =" !isLoading || isShortQuery" icon =" icon-search" >
124133
125134<script >
126135import { emit } from ' @nextcloud/event-bus'
127- import { minSearchLength , getTypes , search , defaultLimit , regexFilterIn , regexFilterNot } from ' ../services/UnifiedSearchService'
136+ import { minSearchLength , getTypes , search , defaultLimit , regexFilterIn , regexFilterNot , enableLiveSearch } from ' ../services/UnifiedSearchService'
128137import { showError } from ' @nextcloud/dialogs'
129138
130139import ActionButton from ' @nextcloud/vue/dist/Components/ActionButton'
@@ -175,9 +184,11 @@ export default {
175184
176185 query: ' ' ,
177186 focused: null ,
187+ triggered: false ,
178188
179189 defaultLimit,
180190 minSearchLength,
191+ enableLiveSearch,
181192
182193 open: false ,
183194 }
@@ -354,6 +365,7 @@ export default {
354365 this .reached = {}
355366 this .results = {}
356367 this .focused = null
368+ this .triggered = false
357369 await this .cancelPendingRequests ()
358370 },
359371
@@ -422,6 +434,7 @@ export default {
422434
423435 // Reset search if the query changed
424436 await this .resetState ()
437+ this .triggered = true
425438 this .$set (this .loading , ' all' , true )
426439 this .logger .debug (` Searching ${ query} in` , types)
427440
@@ -481,9 +494,13 @@ export default {
481494 this .loading = {}
482495 })
483496 },
484- onInputDebounced: debounce (function (e ) {
485- this .onInput (e)
486- }, 200 ),
497+ onInputDebounced: enableLiveSearch
498+ ? debounce (function (e ) {
499+ this .onInput (e)
500+ }, 500 )
501+ : function () {
502+ this .triggered = false
503+ },
487504
488505 /**
489506 * Load more results for the provided type
@@ -728,7 +745,7 @@ $input-padding: 6px;
728745 }
729746 }
730747
731- & -reset {
748+ & -reset , & -submit {
732749 position : absolute ;
733750 top : 0 ;
734751 right : 0 ;
@@ -746,6 +763,10 @@ $input-padding: 6px;
746763 opacity : 1 ;
747764 }
748765 }
766+
767+ & -submit {
768+ right : 28px ;
769+ }
749770 }
750771
751772 & __filters {
0 commit comments