Disable OS keyboard on terminal load
This commit is contained in:
1 parent
b04f6b3b60
commit
7421a695ee
1 file changed
+5
-2
@@ -178,11 +178,14 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
|
||||
terminal.loadAddon(webLinksAddon);
|
||||
terminal.open(xtermRef.current);
|
||||
|
||||
const textarea = xtermRef.current.querySelector('.xterm-helper-textarea');
|
||||
const textarea = xtermRef.current.querySelector('.xterm-helper-textarea') as HTMLTextAreaElement | null;
|
||||
if (textarea) {
|
||||
textarea.setAttribute('readonly', 'true');
|
||||
textarea.readOnly = true;
|
||||
textarea.blur();
|
||||
}
|
||||
|
||||
terminal.focus = () => {};
|
||||
|
||||
const resizeObserver = new ResizeObserver(() => {
|
||||
if (resizeTimeout.current) clearTimeout(resizeTimeout.current);
|
||||
resizeTimeout.current = setTimeout(() => {
|
||||
|
||||
Reference in new issue
Block a user