mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
Fix undefined resizeObserver error during split
This commit is contained in:
parent
3eaf743b5a
commit
cd655ad1e6
1 changed files with 5 additions and 7 deletions
|
|
@ -426,18 +426,16 @@ export default class Term extends React.PureComponent {
|
||||||
onTermWrapperRef(component) {
|
onTermWrapperRef(component) {
|
||||||
this.termWrapperRef = component;
|
this.termWrapperRef = component;
|
||||||
|
|
||||||
let resizeTimeout;
|
|
||||||
let resizeObserver;
|
|
||||||
if (component) {
|
if (component) {
|
||||||
resizeObserver = new ResizeObserver(() => {
|
this.resizeObserver = new ResizeObserver(() => {
|
||||||
clearTimeout(resizeTimeout);
|
clearTimeout(this.resizeTimeout);
|
||||||
resizeTimeout = setTimeout(() => {
|
this.resizeTimeout = setTimeout(() => {
|
||||||
this.fitResize();
|
this.fitResize();
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
resizeObserver.observe(component);
|
this.resizeObserver.observe(component);
|
||||||
} else {
|
} else {
|
||||||
resizeObserver.disconnect();
|
this.resizeObserver.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue