diff --git a/frontend/src/components/facility3d/FacilityScene.tsx b/frontend/src/components/facility3d/FacilityScene.tsx index 3f40cd6..e89f077 100644 --- a/frontend/src/components/facility3d/FacilityScene.tsx +++ b/frontend/src/components/facility3d/FacilityScene.tsx @@ -45,6 +45,12 @@ export function FacilityScene({ useEffect(() => { const handleDown = (e: KeyboardEvent) => { + // Don't capture keys when an input/textarea is focused + const activeEl = document.activeElement; + if (activeEl && (activeEl.tagName === 'INPUT' || activeEl.tagName === 'TEXTAREA')) { + return; + } + if (['KeyW', 'KeyA', 'KeyS', 'KeyD', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.code)) { e.preventDefault(); setKeysPressed(k => ({ ...k, [e.code]: true }));