fix: trim spaces for search keyword
This commit is contained in:
parent
509eec5f87
commit
c28d1e1537
3 changed files with 20 additions and 16 deletions
|
@ -221,7 +221,7 @@ const onKeyDown = (e: KeyboardEvent) => {
|
|||
</template>
|
||||
<div v-else p5 text-center text-secondary italic>
|
||||
{{
|
||||
input.length
|
||||
input.trim().length
|
||||
? $t('common.not_found')
|
||||
: $t('search.search_desc')
|
||||
}}
|
||||
|
|
|
@ -77,17 +77,19 @@ const activate = () => {
|
|||
<!-- Results -->
|
||||
<div left-0 top-12 absolute w-full z10 group-focus-within="pointer-events-auto visible" invisible pointer-events-none>
|
||||
<div w-full bg-base border="~ base" rounded-3 max-h-100 overflow-auto py2>
|
||||
<span v-if="query.length === 0" block text-center text-sm text-secondary>
|
||||
<span v-if="query.trim().length === 0" block text-center text-sm text-secondary>
|
||||
{{ t('search.search_desc') }}
|
||||
</span>
|
||||
<template v-if="!loading">
|
||||
<SearchResult
|
||||
v-for="(result, i) in results" :key="result.id"
|
||||
:active="index === parseInt(i.toString())"
|
||||
:result="result"
|
||||
:tabindex="focused ? 0 : -1"
|
||||
/>
|
||||
<span v-if="query.length !== 0 && results.length === 0" block text-center text-sm text-secondary>
|
||||
<template v-else-if="!loading">
|
||||
<template v-if="results.length > 0">
|
||||
<SearchResult
|
||||
v-for="(result, i) in results" :key="result.id"
|
||||
:active="index === parseInt(i.toString())"
|
||||
:result="result"
|
||||
:tabindex="focused ? 0 : -1"
|
||||
/>
|
||||
</template>
|
||||
<span v-else block text-center text-sm text-secondary>
|
||||
{{ t('search.search_empty') }}
|
||||
</span>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue