From 866d46f22d01c2106a265840270f30761b59c283 Mon Sep 17 00:00:00 2001 From: rahuldsce Date: Wed, 4 Mar 2020 11:43:44 +0530 Subject: [PATCH] VM focus by default (#178) --- src/container/TerminalViewer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/container/TerminalViewer.js b/src/container/TerminalViewer.js index a5dce67476..61da9ca781 100644 --- a/src/container/TerminalViewer.js +++ b/src/container/TerminalViewer.js @@ -40,6 +40,7 @@ class MexTerminal extends Component { this.success = false; this.localConnection = null; this.sendChannel = null; + this.vmPage = React.createRef() } setRemote = (mcRequest) => { @@ -360,7 +361,7 @@ class MexTerminal extends Component { loadVMPage = () => { - return + return } render() { @@ -403,9 +404,9 @@ class MexTerminal extends Component { } componentDidMount(){ - if(document.getElementById('vmPage')) + if(this.vmPage && this.vmPage.current) { - document.getElementById('vmPage').focus() + this.vmPage.current.focus() } this.setState({ forms : this.getForms()