mirror of
https://github.com/welpo/tabi.git
synced 2026-03-10 10:07:21 +01:00
🐛 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:
parent
f59d440165
commit
dff13b6a28
2 changed files with 4 additions and 3 deletions
|
|
@ -3157,7 +3157,8 @@ window.onload = function () {
|
||||||
if (
|
if (
|
||||||
['ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown'].includes(
|
['ArrowUp', 'ArrowDown', 'Home', 'End', 'PageUp', 'PageDown'].includes(
|
||||||
event.key
|
event.key
|
||||||
)
|
) &&
|
||||||
|
!event.isComposing
|
||||||
) {
|
) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
let newIndex = activeDivIndex;
|
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.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
const anchorTag = activeDiv.querySelector('a');
|
const anchorTag = activeDiv.querySelector('a');
|
||||||
|
|
|
||||||
2
static/js/searchElasticlunr.min.js
vendored
2
static/js/searchElasticlunr.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue