Skip to content

Commit c36202f

Browse files
artemdanylenkoerictraut
authored andcommitted
In case we are setting the scroll position manually and there is scheduled _onScroll callback for trailing end of interval - cancel it to not report old scroll position to parent component (#210)
1 parent bc97043 commit c36202f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/web/ScrollView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ export class ScrollView extends ViewBase<Types.ScrollViewProps, {}> implements R
276276
if (!container) {
277277
return;
278278
}
279+
this._onScroll.cancel();
279280
if (animate) {
280281
const start = container.scrollTop;
281282
const change = scrollTop - start;
@@ -304,6 +305,7 @@ export class ScrollView extends ViewBase<Types.ScrollViewProps, {}> implements R
304305
if (!container) {
305306
return;
306307
}
308+
this._onScroll.cancel();
307309
if (animate) {
308310
const start = container.scrollLeft;
309311
const change = scrollLeft - start;

0 commit comments

Comments
 (0)