Skip to content

Commit

Permalink
Merge pull request #1929 from coderaiser/patch-1
Browse files Browse the repository at this point in the history
fix: Renderer: IntersectionObserver can produce more then 1 entry
  • Loading branch information
Tyriar committed Mar 4, 2019
2 parents 1eee182 + 05b162e commit d8b973b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/Renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Renderer extends EventEmitter implements IRenderer {
// Detect whether IntersectionObserver is detected and enable renderer pause
// and resume based on terminal visibility if so
if ('IntersectionObserver' in window) {
const observer = new IntersectionObserver(e => this.onIntersectionChange(e[0]), { threshold: 0 });
const observer = new IntersectionObserver(e => this.onIntersectionChange(e[e.length - 1]), { threshold: 0 });
observer.observe(this._terminal.element);
this.register({ dispose: () => observer.disconnect() });
}
Expand Down

0 comments on commit d8b973b

Please sign in to comment.