diff --git a/lib/components/term.js b/lib/components/term.js index 31bc7047..1f860e92 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -67,7 +67,7 @@ export default class Term extends Component { // this.term.CursorNode_ is available at this point. this.term.setCursorShape(props.cursorShape); }; - this.term.decorate(this.refs.term); + this.term.decorate(this.termRef); this.term.installKeyboard(); if (this.props.onTerminal) { this.props.onTerminal(this.term); @@ -191,8 +191,8 @@ export default class Term extends Component { handleMouseDown(ev) { // we prevent losing focus when clicking the boundary // wrappers of the main terminal element - if (ev.target === this.refs.term_wrapper || - ev.target === this.refs.term) { + if (ev.target === this.termWrapperRef || + ev.target === this.termRef) { ev.preventDefault(); } } @@ -271,13 +271,20 @@ export default class Term extends Component { template(css) { return (
{ + this.termWrapperRef = component; + }} className={css('fit')} onMouseDown={this.handleMouseDown} style={{padding: this.props.padding}} > { this.props.customChildrenBefore } -
+
{ + this.termRef = component; + }} + className={css('fit', 'term')} + /> { this.props.url ?