From da2f6dd1f54c6593fecc1b8f12ab96ca3f16bfca Mon Sep 17 00:00:00 2001 From: Alex Cube Date: Mon, 10 Aug 2026 15:31:25 +0300 Subject: [PATCH] Fix: global keydown hotkeys ate letters while typing in the name input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R/N/P/F/G/W/A/S/D and arrows all preventDefault()'d unconditionally, even with focus in #settings-name-input — swallowed those letters mid-typing (very noticeable for English names). Skip the hotkey handler entirely when an is focused. --- php/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/index.php b/php/index.php index ed46e73..f65558c 100644 --- a/php/index.php +++ b/php/index.php @@ -2065,6 +2065,10 @@ function draw() { // ============ ВВОД ============ const keys = {}; window.addEventListener('keydown', e => { + // фокус в текстовом поле (например, ввод имени) — не перехватываем хоткеи, + // иначе R/N/P/F/G/W/A/S/D и стрелки режут буквы прямо во время печати + if (document.activeElement && document.activeElement.tagName === 'INPUT') return; + const key = e.key.toLowerCase(); if (key === 'escape' && (solveState || pendingSolution)) { cancelAutoSolve(); e.preventDefault(); return; }