From e00323988b24f28a3df429799bb425adbe206ac0 Mon Sep 17 00:00:00 2001 From: ariasuni Date: Thu, 3 Sep 2026 20:35:45 +0200 Subject: [PATCH] fix: ignore text entered into search bar when compositing --- src/sidebar/components/bar.search.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sidebar/components/bar.search.vue b/src/sidebar/components/bar.search.vue index 366f585e4..012e7d5c5 100644 --- a/src/sidebar/components/bar.search.vue +++ b/src/sidebar/components/bar.search.vue @@ -112,7 +112,14 @@ function onKD(e: KeyboardEvent): void { } } -function onInput(e: Event) { +function onInput(e: InputEvent) { + // Ignore text entered during composition, before the real text is committed. + // For example, when using an Input Method Editor for typing Japanese, you enter temporary + // latin characters that you convert into the appropriate kanas or kanjis, and then validate. + // Also, on some systems, the usual dead keys work like that. + // https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/isComposing + if (e.isComposing) return + const rawQuery = (e.target as HTMLInputElement | null)?.value ?? '' if (Settings.state.searchInputTimeout > 0) {