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:
Hypo
2026-02-08 14:39:09 +08:00
committed by GitHub
parent a60201a071
commit ef529de0ac
8 changed files with 9 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ window.customElements.define('overflow-menu', class extends HTMLElement {
const div = document.createElement('div');
div.tabIndex = -1; // for initial focus, programmatic focus only
div.addEventListener('keydown', (e) => {
if (e.isComposing) return;
if (e.key === 'Tab') {
const items = this.tippyContent.querySelectorAll<HTMLElement>('[role="menuitem"]');
if (e.shiftKey) {