Skip to content
Permalink
Browse files

fix(repeat): ensure revert mutation handling

  • Loading branch information...
bigopon committed Apr 7, 2019
1 parent d5a39a0 commit 869bc344a7bbea9e067133f33d59e64d3b13707e
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/array-virtual-repeat-strategy.ts
@@ -486,6 +486,7 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy implements I
let first_index_after_scroll_adjustment = realScrolltop === 0
? 0
: Math$floor(realScrolltop / itemHeight);

// if first index after scroll adjustment doesn't fit with number of possible view
// it means the scroller has been too far down to the bottom and nolonger suitable to start from this index
// rollback until all views fit into new collection, or until has enough collection item to render
@@ -500,7 +501,7 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy implements I
// repeat._isLastIndex = bot_buffer_item_count_after_scroll_adjustment === 0;
repeat.topBufferHeight = top_buffer_item_count_after_scroll_adjustment * itemHeight;
repeat.bottomBufferHeight = bot_buffer_item_count_after_scroll_adjustment * itemHeight;
// repeat._handlingMutations = false;
(repeat as VirtualRepeat)._handlingMutations = false;
// ensure scroller scroll is handled
(repeat as VirtualRepeat).revertScrollCheckGuard();
repeat.updateBufferElements();

0 comments on commit 869bc34

Please sign in to comment.
You can’t perform that action at this time.