Our state of the art Gantt chart


Post by rick1 »

Hi,

Non-working time of parent calendars are not visible on initial render using the Gantt React component. The non-working time will show up after a rerender. This bug does not appear when using react strict mode because that makes everything render twice. I also noticed that non-working time disappear/appear on each rerender when using the tasknonworking time feature.

Repro:

  1. Run the sample and see that only one non-working day is visible.
  2. Trigger a refresh using the button at the top
  3. The non-working time of the parent calendar appears.

Sample:
React v19.1.0
Bryntum v7.2.1

const App = () => {
    const ganttRef = useRef<BryntumGantt>(null);
    const projectRef = useRef<BryntumGanttProjectModel>(null);

const [triggerRerender, setTriggerRerender] = useState(false);

return <>
    <button style={{margin: "15px" }} onClick={() => { setTriggerRerender(!triggerRerender); }}>Trigger rerender</button>

    <BryntumGanttProjectModel
        ref={projectRef}
        tasks={[
            {
                id: "t1",
                name: "Test task",
                startDate: new Date(2020, 1, 1),
                endDate: new Date(2020, 1, 13),
            }
        ]}
        calendars={[
            {
                id: "c2",
                intervals: [{
                    id: "i1",
                    startDate: new Date(2020, 1, 3),
                    endDate: new Date(2020, 1, 4),
                    isWorking: false
                }]
            },
            {
                id: "c1",
                parentId: "c2",
                intervals: [{
                    id: "i1",
                    startDate: new Date(2020, 1, 1),
                    endDate: new Date(2020, 1, 2),
                    isWorking: false
                }]
            }
        ]}
        calendar={"c1"}
    />

    <BryntumGantt
        ref={ganttRef}
        project={projectRef}
    />
</>
};

Post by ahmadzaheer »

Hello,

Thanks for reporting this. We have created a ticket for it which you can track here: https://github.com/bryntum/support/issues/12785

Regards,
Ahmad Zaheer


Post Reply