feat: use explorer page as search for mobile only (#1301)

This commit is contained in:
Michel EDIGHOFFER 2023-02-03 11:40:54 +01:00 committed by GitHub
parent a2fb458696
commit 4b1b18768d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 41 deletions

View file

@ -5,9 +5,14 @@ const index = ref(0)
const { t } = useI18n()
const el = ref<HTMLElement>()
const input = ref<HTMLInputElement>()
const router = useRouter()
const { focused } = useFocusWithin(el)
defineExpose({
input,
})
const results = computed(() => {
if (query.value.length === 0)
return []
@ -68,6 +73,7 @@ const activate = () => {
bg-transparent
outline="focus:none"
pe-4
ml-1
:placeholder="isHydrated ? t('nav.search') : ''"
pb="1px"
placeholder-text-secondary
@ -77,7 +83,7 @@ const activate = () => {
>
</div>
<!-- Results -->
<div left-0 top-12 absolute w-full z10 group-focus-within="pointer-events-auto visible" invisible pointer-events-none>
<div left-0 top-11 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.trim().length === 0" block text-center text-sm text-secondary>
{{ t('search.search_desc') }}