mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
@@ -217,9 +217,14 @@ export function TerminalInput(): React.ReactElement {
|
||||
const ref = terminalInput.current;
|
||||
if (event.ctrlKey || event.metaKey) return;
|
||||
if (event.key === KEY.C && (event.ctrlKey || event.metaKey)) return; // trying to copy
|
||||
// Don't steal focus from other input elements (e.g., prompt dialogs)
|
||||
// Don't steal focus from other input elements
|
||||
const target = event.target;
|
||||
if ((target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) && target !== ref) {
|
||||
if (
|
||||
(target instanceof HTMLInputElement ||
|
||||
target instanceof HTMLTextAreaElement ||
|
||||
(target instanceof HTMLElement && target.isContentEditable)) &&
|
||||
target !== ref
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (ref) ref.focus();
|
||||
|
||||
Reference in New Issue
Block a user