fullcalendar / fullcalendar-react

The official React Component for FullCalendar
https://fullcalendar.io/docs/react
MIT License
2.09k stars 110 forks source link

Resouce timeline does not scroll correctly in StrictMode #192

Closed GeorchW closed 2 years ago

GeorchW commented 2 years ago

Description

When rendering a resource timeline inside React.StrictMode, the time and the main section are not scrolling synchronously.

https://user-images.githubusercontent.com/8687777/171181769-e5be24f1-1f48-4ef4-815d-17f8aab9b285.mp4

React.StrictMode is enabled by default in many project templates, for example in the official default create-react-app template, as well as its typescript and redux siblings. Officially, the docs for StrictMode say that it's purely a development thing that prints more warnings to the console.

Reproduction

Code Sandbox: https://codesandbox.io/s/silly-visvesvaraya-vkiv3r?file=/src/main.jsx

Relevant code bits:

import React from "react";
import { createRoot } from "react-dom/client";
import FullCalendar from "@fullcalendar/react";
import resourceTimelinePlugin from "@fullcalendar/resource-timeline";

document.addEventListener("DOMContentLoaded", function () {
  createRoot(document.body.appendChild(document.createElement("div"))).render(
    <React.StrictMode>
      <FullCalendar plugins={[resourceTimelinePlugin]} />
    </React.StrictMode>
  );
});
timofei-maximov-saritasa commented 2 years ago

I've got simillar issue but with resourceTimeGridDay view. Scrollbars doesn't sync whenever I set allDay flag dynamically to true. But everything becomes fine when I add another resource dynamically. Here are the plugins: [resourceTimeGridPlugin, scrollGridPlugin, momentPlugin, interactionPlugin]

And also, I'm not sure if its related or not: I get error if I set height:auto. It only happens if there allday on current selected date

image

https://user-images.githubusercontent.com/86595911/172841784-6849db43-36d4-491a-92b4-65ca0e0f3c29.mov

Muhammad-Bilal-2 commented 2 years ago

Yes I have the same issue and not able to find any solution yet

arshaw commented 2 years ago

Fixed in v5.11.2

Updated repro: https://codesandbox.io/s/dreamy-phoebe-xbfuju?file=/package.json

@timofei-maximov-saritasa, I did not attempt to reproduce your problem. If you could try v5.11.2, and if it doesn't solve your issue, post another ticket (with a repro), that'd be great.

Xxq0217 commented 6 months ago

vue2 has a similar problem. We are currently using 4.3.0, can we upgrade it