🐛 fix(search): prevent IME composition from triggering navigation (#628)
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user