Skip to content
Permalink
Browse files

fix(array-repeat): properly check when to ignore update views

  • Loading branch information...
bigopon committed Mar 13, 2019
1 parent 45d1209 commit 9b9d5b78e857a158be0442d88e17639f87968347
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/array-virtual-repeat-strategy.ts
@@ -101,6 +101,7 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy implements I
const overrideContext = view.overrideContext;
// any changes to the binding context?
if (bindingContext[local] === items[currIndex]
&& overrideContext.$index === currIndex
&& overrideContext.$middle === middle
&& overrideContext.$last === last
) {
@@ -109,9 +110,13 @@ export class ArrayVirtualRepeatStrategy extends ArrayRepeatStrategy implements I
}
// update the binding context and refresh the bindings.
bindingContext[local] = items[currIndex];
overrideContext.$first = currIndex === 0;
overrideContext.$middle = middle;
overrideContext.$last = last;
overrideContext.$index = currIndex;
const odd = currIndex % 2 === 1;
overrideContext.$odd = odd;
overrideContext.$even = !odd;
repeat.updateBindings(view);
}
// add new views

0 comments on commit 9b9d5b7

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