Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No string refs #766

Merged
merged 5 commits into from
Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions lib/components/term.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -271,13 +271,20 @@ export default class Term extends Component {

template(css) {
return (<div
ref="term_wrapper"
ref={component => {
this.termWrapperRef = component;
}}
className={css('fit')}
onMouseDown={this.handleMouseDown}
style={{padding: this.props.padding}}
>
{ this.props.customChildrenBefore }
<div ref="term" className={css('fit', 'term')}/>
<div
ref={component => {
this.termRef = component;
}}
className={css('fit', 'term')}
/>
{ this.props.url ?
<webview
src={this.props.url}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"import/no-extraneous-dependencies": 0,
"no-warning-comments": 0,
"complexity": 0,
"react/no-string-refs": 0,
"react/jsx-key": 0,
"no-nested-ternary": 0,
"react/jsx-no-bind": 0
Expand Down