search page only appears on enter

This commit is contained in:
Core 2022-09-11 03:13:54 +01:00
parent ce598e8b2c
commit 350521ddaf
No known key found for this signature in database
GPG key ID: 2AB8327FBA02D1C0
4 changed files with 9 additions and 6 deletions

View file

@ -25,6 +25,7 @@ const app = new Vue({
cursor: -1,
hints: [],
showHints: false,
showSearchView: false,
results: {},
resultsSocial: {},
resultsLibrary: {},
@ -1904,6 +1905,8 @@ const app = new Vue({
async getSearchHints() {
if (this.search.term == "") {
this.search.hints = [];
this.search.showHints = true
this.search.showSearchView = false
return;
}
let hints = await (

View file

@ -280,7 +280,7 @@
<input type="search" spellcheck="false" @click="$root.appRoute('search');search.showHints = true"
@focus="search.showHints = true"
@blur="setTimeout(()=>{if(hintscontext != true){search.showHints = false} }, 300)"
v-on:keyup.enter="searchQuery(search.hints[search.cursor]?.content ?? search.hints[search.cursor]?.searchTerm ?? search.term);search.showHints = false;search.cursor = -1" @change="$root.appRoute('search');"
v-on:keyup.enter="searchQuery(search.hints[search.cursor]?.content ?? search.hints[search.cursor]?.searchTerm ?? search.term);search.showHints = false;search.showSearchView = true;search.cursor = -1" @change="$root.appRoute('search');"
v-on:keyup="searchCursor"
@input="getSearchHints()"
:placeholder="$root.getLz('term.search') + '...'" v-model="search.term" ref="searchInput"

View file

@ -10,7 +10,7 @@
@click="$root.appRoute('search');$root.search.showHints = true"
@focus="$root.search.showHints = true"
@blur="$root.setTimeout(()=>{if($root.hintscontext != true){$root.search.showHints = false} }, 300)"
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false;$root.search.cursor = -1"
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false;$root.search.showSearchView = true;$root.search.cursor = -1"
v-on:keyup="$root.searchCursor"
@change="$root.appRoute('search');"
@input="$root.getSearchHints()"

View file

@ -4,7 +4,7 @@
<div class="search-input--icon"></div>
<input type="search" spellcheck="false" @focus="$root.search.showHints = true"
@blur="$root.setTimeout(()=>{if($root.hintscontext != true){$root.search.showHints = false} }, 300)"
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false" @input="$root.getSearchHints()"
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false; $root.search.showSearchView = true" @input="$root.getSearchHints()"
:placeholder="$root.getLz('term.search') + '...'" v-model="$root.search.term"
class="search-input" />
@ -33,7 +33,7 @@
$root.getLz("term.library") }}
</button>
</div>
<div v-if="search != null && search != [] && search.term != ''">
<div v-if="search != null && search != [] && search.term != '' && $root.search.showSearchView">
<template v-if="searchType == 'catalog'">
<h3>{{app.getLz('term.topResult')}}</h3>
<mediaitem-scroller-horizontal