mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Focus term if needed when restoring (#2658)
* Focus term if needed when restoring * Fix Tab component warnings
This commit is contained in:
parent
4d8d56bfc5
commit
887fb5ac1a
2 changed files with 4 additions and 10 deletions
|
|
@ -14,10 +14,6 @@ export default class Tab extends PureComponent {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
handleHover() {
|
handleHover() {
|
||||||
this.setState({
|
this.setState({
|
||||||
hovered: true
|
hovered: true
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,9 @@ export default class Term extends PureComponent {
|
||||||
//We need to set options again after reattaching an existing term
|
//We need to set options again after reattaching an existing term
|
||||||
Object.keys(this.termOptions).forEach(option => this.term.setOption(option, this.termOptions[option]));
|
Object.keys(this.termOptions).forEach(option => this.term.setOption(option, this.termOptions[option]));
|
||||||
}
|
}
|
||||||
|
if (this.props.isTermActive) {
|
||||||
|
this.term.focus();
|
||||||
|
}
|
||||||
|
|
||||||
this.onOpen(this.termOptions);
|
this.onOpen(this.termOptions);
|
||||||
|
|
||||||
|
|
@ -88,12 +91,7 @@ export default class Term extends PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.onActive) {
|
if (props.onActive) {
|
||||||
this.term.on('focus', () => {
|
this.term.on('focus', props.onActive);
|
||||||
// xterm@2 emits this event 2 times. Will be fixed in xterm@3.
|
|
||||||
if (!this.props.isTermActive) {
|
|
||||||
props.onActive();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.onData) {
|
if (props.onData) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue