Skip to content

Commit

Permalink
VM focus by default (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldsce authored Mar 4, 2020
1 parent ba3f829 commit 866d46f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/container/TerminalViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class MexTerminal extends Component {
this.success = false;
this.localConnection = null;
this.sendChannel = null;
this.vmPage = React.createRef()
}

setRemote = (mcRequest) => {
Expand Down Expand Up @@ -360,7 +361,7 @@ class MexTerminal extends Component {

loadVMPage = () =>
{
return <iframe ref="vmPage" src={this.props.data.vm.url} style={{ width: '100%', height: '100%' }}></iframe>
return <iframe ref={this.vmPage} src={this.props.data.vm.url} style={{ width: '100%', height: '100%' }}></iframe>
}

render() {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 866d46f

Please sign in to comment.