From db2908b3ef89c720d395051f18e926368d807d3f Mon Sep 17 00:00:00 2001 From: rouggy Date: Sat, 18 Jul 2026 14:33:55 +0200 Subject: [PATCH] fix: RIT Ctrl+arrow tuning also works while the QSO entry field has focus The radio-style Ctrl+left/right RIT shortcut skipped any focused input/textarea (to preserve word navigation), but that's exactly where the operator's focus is mid-QSO. Now only the RIT offset row itself is skipped; text-field word nav is overridden only while RIT is engaged. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/components/FlexPanel.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/FlexPanel.tsx b/frontend/src/components/FlexPanel.tsx index 57cc16e..7ea3830 100644 --- a/frontend/src/components/FlexPanel.tsx +++ b/frontend/src/components/FlexPanel.tsx @@ -320,15 +320,18 @@ export function FlexPanel({ onCWSpeed, onReportRST }: { onCWSpeed?: (wpm: number const rxOff = off || !st.rx_avail; // Radio-style global RIT tuning: Ctrl+←/→ nudges the RIT offset (Ctrl+Shift = - // ±100 Hz) from anywhere, without having to click the RIT field first. A - // focused offset row (data-offsetrow) or a text field handles its own keys, so - // this never double-fires. Only active while RIT is on and the RX is available. + // ±100 Hz) from ANYWHERE — including while the callsign/RST entry field has + // focus, which is where the operator is while working a station. Only the RIT + // offset row itself (data-offsetrow) is skipped, since it handles its own + // arrows. Text-field word navigation via Ctrl+← / → is overridden only while + // RIT is actually engaged (guarded below), which is fine mid-QSO. Requires RIT + // on and the RX available. useEffect(() => { const onKey = (e: KeyboardEvent) => { if (!(e.ctrlKey || e.metaKey)) return; if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return; const ae = document.activeElement as HTMLElement | null; - if (ae && (ae.hasAttribute('data-offsetrow') || /^(input|textarea|select)$/i.test(ae.tagName) || ae.isContentEditable)) return; + if (ae && ae.hasAttribute('data-offsetrow')) return; if (!st.rit || rxOff) return; e.preventDefault(); const mag = e.shiftKey ? 100 : 10;