Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot drag events in DayGrid view calendar reinitialized via useState #7286

Open
1 task done
roelkoops opened this issue Apr 17, 2023 · 1 comment
Open
1 task done

Comments

@roelkoops
Copy link

roelkoops commented Apr 17, 2023

Reduced Test Case

https://stackblitz.com/edit/fullcalendar-srcyda

Do you understand that if a reduced test case is not provided, we will intentionally delay triaging of your ticket?

  • I understand

Which connector are you using (React/Angular/etc)?

React

Bug Description

When the initialView is set to ResourceDayGridMonth and there are no resources and events when the component renders for the first time, then rendering problems occur as soon as events and resources are loaded. It's for example not possible to drag/drop an event and eventClick isn't called when clicking on an event.

Steps to reproduce:

  • open the test case

  • click the 'Load' button

  • try to drag the event to another slot (doesn't work)

  • try to click on the event (doesn't work)

  • now switch to the week-view, and then back to the month-view

  • see that the event is draggable and clickable now

  • set the initialView to 'ResourceTimeGridWeek'

  • click the 'Load' button

  • see that the problem does not occur with this (and other) views

@acerix acerix changed the title ResourceDayGridMonth render issue Cannot drag events in DayGrid view calendar reinitialized via useState Apr 26, 2023
@acerix
Copy link
Member

acerix commented Apr 26, 2023

The issues seems to be from using useState to reinitialise the calendar after any changes, this also causes other issues as in #7234.

You could instead supply the event "as a function" to avoid reinitializing it. https://fullcalendar.io/docs/events-function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants