fix: keep virtual keyboard open when tapping special keys

- Use onPointerDown with preventDefault() instead of onClick
- Add onKeepFocus callback to SpecialKeysStrip and SpecialKeysPanel
- Expose focusInput via onTerminalReady in TerminalComponent
- MobileTerminalWrapper passes focus callback to keep keyboard open
This commit is contained in:
Fusion
2026-05-24 11:57:55 +02:00
parent aea1ff95f6
commit 7e0df57f8c
4 changed files with 42 additions and 15 deletions
+10 -3
View File
@@ -10,7 +10,8 @@ interface TerminalProps {
isMobile?: boolean;
onTerminalReady?: (
sendData: (data: string) => void,
connectionStatus: "connecting" | "connected" | "disconnected" | "error"
connectionStatus: "connecting" | "connected" | "disconnected" | "error",
focusInput: () => void
) => void;
}
@@ -196,7 +197,10 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
ws.send(data);
}
};
onTerminalReadyRef.current(sendData, status);
const focusInput = () => {
hiddenInputRef.current?.focus();
};
onTerminalReadyRef.current(sendData, status, focusInput);
}
// Visibility API for reconnection
@@ -225,7 +229,10 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
wsRef.current.send(data);
}
};
onTerminalReady(sendData, status);
const focusInput = () => {
hiddenInputRef.current?.focus();
};
onTerminalReady(sendData, status, focusInput);
}
}, [status, onTerminalReady]);