Skip to content

Commit 95bf2af

Browse files
committed
fix: child can be moved before parent when has multiple parents
1 parent 1a09a38 commit 95bf2af

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/bar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ export default class Bar {
404404
const xs = this.task.dependencies.map((dep) => {
405405
return this.gantt.get_bar(dep).$bar.getX();
406406
});
407-
const valid_x = xs.reduce((_, curr) => {
408-
return x >= curr;
409-
}, x);
407+
const valid_x = xs.reduce((prev, curr) => {
408+
return prev && x >= curr;
409+
}, true);
410410
if (!valid_x) return;
411411
this.update_attr(bar, 'x', x);
412412
this.x = x;

0 commit comments

Comments
 (0)