From 6306472f3406f127dfd0721d83dc2555dea97d4b Mon Sep 17 00:00:00 2001 From: Volodymyr Shatsky Date: Wed, 15 Jun 2016 00:57:22 +0300 Subject: [PATCH] Replace scrollIntoView with scrollIntoViewIfNeeded. --- src/views/BufferComponent.tsx | 2 +- typings/Overrides.d.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/BufferComponent.tsx b/src/views/BufferComponent.tsx index f396a3d4f..274af1b32 100644 --- a/src/views/BufferComponent.tsx +++ b/src/views/BufferComponent.tsx @@ -58,7 +58,7 @@ class RowComponent extends React.Component { key={index}/> ); - return
div && div.scrollIntoView()}>{charGroups}
; + return
div && div.scrollIntoViewIfNeeded()}>{charGroups}
; } } diff --git a/typings/Overrides.d.ts b/typings/Overrides.d.ts index 6a22d0452..fed2c7487 100644 --- a/typings/Overrides.d.ts +++ b/typings/Overrides.d.ts @@ -69,3 +69,7 @@ interface NodeBuffer extends Uint8Array { interface ObjectConstructor { assign(a: A, b: B, c: C, d: D, e: E, f: F): A & B & C & D & E & F; } + +interface HTMLElement { + scrollIntoViewIfNeeded(top?: boolean): void; +}