fix: on mobile, added a delay before showing the keyboard #345
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { debounce } from 'obsidian'
|
import { debounce, Platform } from 'obsidian'
|
||||||
import { toggleInputComposition } from 'src/globals'
|
import { toggleInputComposition } from 'src/globals'
|
||||||
import { createEventDispatcher, tick } from 'svelte'
|
import { createEventDispatcher, tick } from 'svelte'
|
||||||
import type OmnisearchPlugin from '../main'
|
import type OmnisearchPlugin from '../main'
|
||||||
|
import { wait } from "../tools/utils";
|
||||||
|
|
||||||
export let initialValue = ''
|
export let initialValue = ''
|
||||||
export let placeholder = ''
|
export let placeholder = ''
|
||||||
@@ -28,11 +29,13 @@
|
|||||||
|
|
||||||
function selectInput(_?: HTMLElement): void {
|
function selectInput(_?: HTMLElement): void {
|
||||||
tick()
|
tick()
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
|
if (Platform.isMobileApp) await wait(200)
|
||||||
elInput.focus()
|
elInput.focus()
|
||||||
return tick()
|
return tick()
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
|
if (Platform.isMobileApp) await wait(200)
|
||||||
elInput.select()
|
elInput.select()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user