File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ export class Viewport extends Disposable implements IViewport {
36
36
private _activeBuffer : IBuffer ;
37
37
private _renderDimensions : IRenderDimensions ;
38
38
39
+ private _smoothScrollAnimationFrame : number = 0 ;
40
+
39
41
// Stores a partial line amount when scrolling, this is used to keep track of how much of a line
40
42
// is scrolled so we can "scroll" over partial lines and feel natural on touchpads. This is a
41
43
// quick fix and could have a more robust solution in place that reset the value when needed.
@@ -211,7 +213,12 @@ export class Viewport extends Disposable implements IViewport {
211
213
212
214
// Continue or finish smooth scroll
213
215
if ( percent < 1 ) {
214
- this . _coreBrowserService . window . requestAnimationFrame ( ( ) => this . _smoothScroll ( ) ) ;
216
+ if ( ! this . _smoothScrollAnimationFrame ) {
217
+ this . _smoothScrollAnimationFrame = this . _coreBrowserService . window . requestAnimationFrame ( ( ) => {
218
+ this . _smoothScrollAnimationFrame = 0 ;
219
+ this . _smoothScroll ( ) ;
220
+ } ) ;
221
+ }
215
222
} else {
216
223
this . _clearSmoothScrollState ( ) ;
217
224
}
You can’t perform that action at this time.
0 commit comments