diff --git a/client/modules/IDE/components/TextOutput.jsx b/client/modules/IDE/components/TextOutput.jsx index bdd7c35a..67d67db6 100644 --- a/client/modules/IDE/components/TextOutput.jsx +++ b/client/modules/IDE/components/TextOutput.jsx @@ -1,9 +1,15 @@ -import React from 'react'; +import React, { PropTypes } from 'react'; class TextOutput extends React.Component { componentDidMount() { this.canvasTextOutput.focus(); } + componentDidUpdate(prevProps) { + // if the user explicitly clicks on the play button, want to refocus on the text output + if (this.props.isPlaying && this.props.previewIsRefreshing) { + this.canvasTextOutput.focus(); + } + } render() { return (
{ if ((this.props.preferences.textOutput && this.props.ide.isPlaying) || this.props.ide.isTextOutputPlaying) { return ( - + ); } return '';