mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-09 08:27:48 +09:00
Prevent navigation keys from triggering actions during IME composition (#36540)
Fixes #36532 Refined the Enter key trigger logic in the repository filter to prevent actions during IME composition. By checking the e.isComposing property, the filter now correctly distinguishes between "confirming an IME candidate" and "submitting the search." This prevents premature search triggers when users press Enter to select Chinese/Japanese characters. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -225,6 +225,7 @@ function attachDomEvents(dropdown: HTMLElement, focusable: HTMLElement, menu: HT
|
||||
};
|
||||
|
||||
dropdown.addEventListener('keydown', (e: KeyboardEvent) => {
|
||||
if (e.isComposing) return;
|
||||
// here it must use keydown event before dropdown's keyup handler, otherwise there is no Enter event in our keyup handler
|
||||
if (e.key === 'Enter') {
|
||||
const elItem = menu.querySelector<HTMLElement>(':scope > .item.selected, .menu > .item.selected');
|
||||
|
||||
Reference in New Issue
Block a user