From 93bbc2ef220fbbb9f6ccc4b002089afdd1bc58f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 23 Feb 2026 08:05:33 +0100 Subject: [PATCH] fix: improve robustness of search focus keyboard shortcut - Update FontSelector to prevent '/' shortcut from triggering when another input is focused - Ensure consistent behavior for '/' focus across Figlet and Units tools --- components/figlet/FontSelector.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/figlet/FontSelector.tsx b/components/figlet/FontSelector.tsx index 52c1623..f94db9b 100644 --- a/components/figlet/FontSelector.tsx +++ b/components/figlet/FontSelector.tsx @@ -45,8 +45,14 @@ export function FontSelector({ const handleKeyDown = (e: KeyboardEvent) => { // "/" to focus search if (e.key === '/' && !e.ctrlKey && !e.metaKey) { - e.preventDefault(); - searchInputRef.current?.focus(); + const activeElement = document.activeElement; + if ( + activeElement?.tagName !== 'INPUT' && + activeElement?.tagName !== 'TEXTAREA' + ) { + e.preventDefault(); + searchInputRef.current?.focus(); + } } // "Esc" to clear search if (e.key === 'Escape' && searchQuery) {