Skip to content

Commit 94521e3

Browse files
committed
Fix pmc path ordering update.
1 parent 13911b3 commit 94521e3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

dash/dash-renderer/src/actions/paths.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import {
33
filter,
44
find,
55
forEachObjIndexed,
6+
insert,
67
path,
78
propEq,
8-
props
9+
props,
10+
indexOf
911
} from 'ramda';
1012

1113
import {crawlLayout} from './utils';
@@ -46,7 +48,14 @@ export function computePaths(subTree, startingPath, oldPaths, events) {
4648
const values = props(keys, id);
4749
const keyStr = keys.join(',');
4850
const paths = (objs[keyStr] = objs[keyStr] || []);
49-
paths.push({values, path: concat(startingPath, itempath)});
51+
const oldie = oldObjs[keyStr] || [];
52+
const item = {values, path: concat(startingPath, itempath)};
53+
const index = indexOf(item, oldie);
54+
if (index === -1) {
55+
paths.push(item);
56+
} else {
57+
objs[keyStr] = insert(index, item, paths);
58+
}
5059
} else {
5160
strs[id] = concat(startingPath, itempath);
5261
}

0 commit comments

Comments
 (0)