Skip to content

Commit e2ad6da

Browse files
authored
Merge pull request #37 from reg-viz/remove/smooth-scroll
Disable smooth-scroll #27
2 parents 54f95f5 + 7945e03 commit e2ad6da

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/components/VGrid/VGrid.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class VGrid<T, K extends keyof T> extends React.Component<
172172
if (hit) {
173173
// Notify scrolling to the context because we should not check the hash after the scrolling.
174174
this.context.consume();
175-
setTimeout(() => this.scrollTo(hit.offsetIndex, true));
175+
setTimeout(() => this.scrollTo(hit.offsetIndex));
176176
}
177177
}
178178
}
@@ -272,7 +272,7 @@ export class VGrid<T, K extends keyof T> extends React.Component<
272272
this.updateCurrentOffsetIndex();
273273
}
274274

275-
private scrollTo(offsetIndex: number, instant = false) {
275+
private scrollTo(offsetIndex: number) {
276276
const currentTop = scrollY;
277277
const top = this.calculateClientOffsetTop(offsetIndex);
278278
const threshold = this.state.visibleItemsLength * this.rowHeightUnit * 1;
@@ -288,10 +288,7 @@ export class VGrid<T, K extends keyof T> extends React.Component<
288288
requestAnimationFrame(rafCb);
289289
};
290290
requestAnimationFrame(rafCb);
291-
scroll({
292-
top,
293-
behavior: instant ? (('instant' as unknown) as any) : 'smooth',
294-
});
291+
scroll({ top });
295292
}
296293

297294
private updateCurrentOffsetIndex() {

src/styles/global-styles.ts

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const GlobalStyle = createGlobalStyle`
1616
-ms-text-size-adjust: 100%;
1717
font-family: ${FontFamily.SANS_SERIF};
1818
line-height: ${LineHeight.LARGE};
19-
scroll-behavior: smooth;
2019
-webkit-font-smoothing: antialiased;
2120
-moz-osx-font-smoothing: grayscale;
2221
}

0 commit comments

Comments
 (0)