File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -240,15 +240,15 @@ export default defineComponent({
240
240
241
241
handleOptionClick : function ( index ) {
242
242
this . searchState . showOptions = false
243
- if ( this . visibleDataList [ index ] . route ) {
244
- this . inputData = `ft:${ this . visibleDataList [ index ] . route } `
245
- this . $emit ( 'input' , this . inputData )
243
+ const isSearchHistoryClick = this . visibleDataList [ index ] . route
244
+ this . inputData = isSearchHistoryClick ? `ft:${ this . visibleDataList [ index ] . route } ` : this . visibleDataList [ index ]
245
+ this . $emit ( 'input' , this . inputData )
246
+ this . handleClick ( )
247
+
248
+ // update displayed label to match name of the search history entry
249
+ if ( isSearchHistoryClick ) {
246
250
this . inputData = this . $refs . input . value = this . visibleDataList [ index ] . name
247
- } else {
248
- this . inputData = this . visibleDataList [ index ]
249
- this . $emit ( 'input' , this . inputData )
250
251
}
251
- this . handleClick ( )
252
252
} ,
253
253
254
254
/**
@@ -321,6 +321,10 @@ export default defineComponent({
321
321
const lowerCaseInputData = this . inputData . toLowerCase ( )
322
322
323
323
this . visibleDataList = this . dataList . filter ( x => {
324
+ if ( x . name ) {
325
+ return x . name . toLowerCase ( ) . indexOf ( lowerCaseInputData ) !== - 1
326
+ }
327
+
324
328
return x . toLowerCase ( ) . indexOf ( lowerCaseInputData ) !== - 1
325
329
} )
326
330
} ,
Original file line number Diff line number Diff line change @@ -167,10 +167,12 @@ export default defineComponent({
167
167
goToSearch : async function ( queryText , { event } ) {
168
168
const doCreateNewWindow = event && event . shiftKey
169
169
170
+ const isFreeTubeInternalQuery = queryText . startsWith ( 'ft:' )
171
+
170
172
if ( window . innerWidth <= MOBILE_WIDTH_THRESHOLD ) {
171
173
this . $refs . searchContainer . blur ( )
172
174
this . showSearchContainer = false
173
- } else {
175
+ } else if ( ! isFreeTubeInternalQuery ) {
174
176
this . $refs . searchInput . blur ( )
175
177
}
176
178
Original file line number Diff line number Diff line change 98
98
:show-data-when-empty =" true"
99
99
@input =" getSearchSuggestionsDebounce"
100
100
@click =" goToSearch"
101
+ @clear =" lastSuggestionQuery = ''"
101
102
/>
102
103
<font-awesome-icon
103
104
class =" navFilterIcon navIcon"
You can’t perform that action at this time.
0 commit comments