fix: on mobile, added a delay before showing the keyboard #345

This commit is contained in:
Simon Cambier
2024-08-13 18:55:08 +02:00
parent 1ccfe23d7a
commit 34e7f378da

View File

@@ -1,8 +1,9 @@
<script lang="ts">
import { debounce } from 'obsidian'
import { debounce, Platform } from 'obsidian'
import { toggleInputComposition } from 'src/globals'
import { createEventDispatcher, tick } from 'svelte'
import type OmnisearchPlugin from '../main'
import { wait } from "../tools/utils";
export let initialValue = ''
export let placeholder = ''
@@ -28,11 +29,13 @@
function selectInput(_?: HTMLElement): void {
tick()
.then(() => {
.then(async () => {
if (Platform.isMobileApp) await wait(200)
elInput.focus()
return tick()
})
.then(() => {
.then(async () => {
if (Platform.isMobileApp) await wait(200)
elInput.select()
})
}