Skip to content

Commit

Permalink
Fix bug in a new fragment update algo
Browse files Browse the repository at this point in the history
  • Loading branch information
localvoid committed Apr 25, 2019
1 parent 6debc84 commit 32559a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ivi/src/vdom/reconciler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,12 @@ export function _update(
} else if ((f & (NodeFlags.Fragment | NodeFlags.TrackByKey)) !== 0) {
if ((f & NodeFlags.Fragment) !== 0) {
i = (nextOp as OpArray).length;
opState.c = nextValue = Array(i);
if (i === 0) {
_unmount(parentElement, opState, singleChild);
} else {
prevData = (opStateChildren as Array<OpState | null>).length;
if (i !== prevData) {
opState.c = nextValue = Array(i);
while (prevData > i) {
nextData = (opStateChildren as Array<OpState | null>)[--prevData];
if (nextData !== null) {
Expand All @@ -544,6 +544,8 @@ export function _update(
while (i > prevData) {
nextValue[--i] = _mount(parentElement, (nextOp as OpArray)[i]);
}
} else {
nextValue = (opStateChildren as Array<OpState | null>);
}
while (i > 0) {
nextValue[--i] = _update(
Expand Down

0 comments on commit 32559a0

Please sign in to comment.