#50 - Handling compositionStart/End events

This commit is contained in:
Simon Cambier
2022-05-15 09:08:06 +02:00
parent 69e062bc69
commit 6852c26958
3 changed files with 16 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import { debounce } from "obsidian"
import { toggleInputComposition } from "src/globals"
import { createEventDispatcher, onMount, tick } from "svelte"
export let value = ""
@@ -22,6 +23,8 @@ const debouncedOnInput = debounce(() => {
bind:value
bind:this={elInput}
on:input={debouncedOnInput}
on:compositionstart={(_) => toggleInputComposition(true)}
on:compositionend={(_) => toggleInputComposition(false)}
type="text"
class="prompt-input"
placeholder="Type to search through your notes"