🐛 fix(search): prevent IME composition from triggering navigation

Add `!event.isComposing` guards to the arrow-key and Enter handlers
in the search modal. This prevents keydown events fired during IME
composition (e.g. Japanese input) from being intercepted:

- Arrow keys no longer move result selection while choosing candidates
- Enter no longer navigates to a result while confirming a character

Closes #626
This commit is contained in:
Vincent Ethier 2026-02-24 11:05:19 -08:00
parent f59d440165
commit dff13b6a28
2 changed files with 4 additions and 3 deletions

View file

@ -3157,7 +3157,8 @@ window.onload = function () {
if (
['ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown'].includes(
event.key
)
) &&
!event.isComposing
) {
event.preventDefault();
let newIndex = activeDivIndex;
@ -3188,7 +3189,7 @@ window.onload = function () {
}
}
if (event.key === 'Enter' && activeDiv) {
if (event.key === 'Enter' && activeDiv && !event.isComposing) {
event.preventDefault();
event.stopImmediatePropagation();
const anchorTag = activeDiv.querySelector('a');

File diff suppressed because one or more lines are too long