diff --git a/lib/components/tab.js b/lib/components/tab.js index 1f2a871d..dbe51c24 100644 --- a/lib/components/tab.js +++ b/lib/components/tab.js @@ -14,10 +14,6 @@ export default class Tab extends PureComponent { }; } - shouldComponentUpdate() { - return true; - } - handleHover() { this.setState({ hovered: true diff --git a/lib/components/term.js b/lib/components/term.js index 312c3ea3..d0e2949a 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -80,6 +80,9 @@ export default class Term extends PureComponent { //We need to set options again after reattaching an existing term Object.keys(this.termOptions).forEach(option => this.term.setOption(option, this.termOptions[option])); } + if (this.props.isTermActive) { + this.term.focus(); + } this.onOpen(this.termOptions); @@ -88,12 +91,7 @@ export default class Term extends PureComponent { } if (props.onActive) { - this.term.on('focus', () => { - // xterm@2 emits this event 2 times. Will be fixed in xterm@3. - if (!this.props.isTermActive) { - props.onActive(); - } - }); + this.term.on('focus', props.onActive); } if (props.onData) {