Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Replace scrollIntoView with scrollIntoViewIfNeeded.
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-shatskyi committed Jun 14, 2016
1 parent 396d525 commit 6306472
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/BufferComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RowComponent extends React.Component<RowProps, {}> {
key={index}/>
);

return <div style={this.props.style} ref={(div: HTMLElement | undefined) => div && div.scrollIntoView()}>{charGroups}</div>;
return <div style={this.props.style} ref={(div: HTMLElement | undefined) => div && div.scrollIntoViewIfNeeded()}>{charGroups}</div>;
}
}

Expand Down
4 changes: 4 additions & 0 deletions typings/Overrides.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ interface NodeBuffer extends Uint8Array {
interface ObjectConstructor {
assign<A, B, C, D, E, F>(a: A, b: B, c: C, d: D, e: E, f: F): A & B & C & D & E & F;
}

interface HTMLElement {
scrollIntoViewIfNeeded(top?: boolean): void;
}

0 comments on commit 6306472

Please sign in to comment.