gantt
gantt copied to clipboard
browser locked
when I want to drag task the entire page are locked and page not response any more i config it exactly like Readme file. what should i do?
You are likely having the same issue I had, which seemed to be caused by complex dependency nesting. There is an issue with the way dependencies are resolved, which can lead to infinite loops with certain dependency trees. I have a fix for this. Will PR at some point.
For me this option seems to solve the problem:
popup_trigger: 'mouseover'
Ok i think i've find the real issue, when two tasks are dependent, it create an infinite loop in in Gantt class 's method get_all_dependent_tasks.
It's not perfect but my fix prevent the browser block.
Replace
const ids = [parent_bar_id, ...this.get_all_dependent_tasks(parent_bar_id)];
By this
this.initial_id = parent_bar_id; const ids = [parent_bar_id, ...this.get_all_dependent_tasks(parent_bar_id)];
And this
get_all_dependent_tasks(task_id) { let out = []; let to_process = [task_id]; while (to_process.length) { const deps = to_process.reduce((acc, curr) => { acc = acc.concat(this.dependency_map[curr]); return acc; }, []); out = out.concat(deps); to_process = deps.filter(d => !to_process.includes(d)); } return out.filter(Boolean); }
by this
get_all_dependent_tasks(task_id) { let out = []; for (let task of this.tasks) { if (task.id == task_id) { for (let dep of task.dependencies) { out.push(dep); if (dep != this.initial_id) { out.concat(this.get_all_dependent_tasks(dep)); } } out.concat(task.dependencies); } } return out; }
Can you create a PR for your fix?
Can This be escalated to a higher priority? this is an absolutely crippling bug. (which still exists btw)
Hey @Andrelopithecus @m50S79sM6SRNp8Jn: am I correct in understanding that this happens when two tasks depend on each other?
While I agree that we should fix something, technically users shouldn't be allowed to do that.
@gryphonmyers if you have a PR, could you submit?
Hey @Andrelopithecus @m50S79sM6SRNp8Jn: am I correct in understanding that this happens when two tasks depend on each other?
While I agree that we should fix something, technically users shouldn't be allowed to do that.
@gryphonmyers if you have a PR, could you submit?
Sorry, it's been so long and I don't appear to have a fork of this, so I probably never committed my fix and have no hope of finding it. If memory serves, it was not a case of circular relationships, it was an issue that happened during pretty normal use.
I think we can close this then, as it's 5+ years old and the details aren't clear. If anybody faces this, please comment here/add a new issue.