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

Error when eventContent is providing domNodes as a view-specific option then switching to a view that does not have eventContent defined #6079

Closed
divya-sk-tfs-zz opened this issue Jan 13, 2021 · 6 comments

Comments

@divya-sk-tfs-zz
Copy link

divya-sk-tfs-zz commented Jan 13, 2021

Reduced Test Case: https://codepen.io/divyask53/pen/QWKZYQq?editors=001

Bug Description

  1. open the codepen link https://codepen.io/divyask53/pen/QWKZYQq?editors=001
  2. initial view is set to dayGridMonth (initialView: 'dayGridMonth)
  3. click dayGridWeek (week view)
  4. by clicking back or prev button in week view, move to the week view which has got events for that particular week
    for example we have events on July 14 and July 18 2021, so move to Jan 10 – 16, 2021 range in week view
  5. now click month view
    6)in console we get the below error
    Uncaught TypeError: Cannot convert undefined or null to object
    at slice ()
    at Object.Yo [as render] (main.min.js:6)
    at t.updateCustomContent (main.min.js:6)
    at t.componentDidUpdate (main.min.js:6)
    at t. (main.min.js:6)
    at main.min.js:6
    at Array.some ()
    at main.min.js:6
    at Array.some ()
    at P (main.min.js:6)

Screenshot:
error

@acerix
Copy link
Member

acerix commented Jan 13, 2021

Thanks, confirmed.

The bug seems to happen when eventContent is providing domNodes as a view-specific option then switching to a view that does not have eventContent defined. I simplified the demo to show the error just by switching to month view:

https://codepen.io/acerix/pen/QWKJyPN?editors=0010

It can be fixed by supplying eventContent for all views or having a default:

https://codepen.io/acerix/pen/PoGxNYo?editors=0010

Also reported in https://fullcalendar.freshdesk.com/a/tickets/2565

@acerix acerix changed the title Full calendar application breaks, when user navigate from dayGridWeek to dayGridMonth Error when eventContent is providing domNodes as a view-specific option then switching to a view that does not have eventContent defined Jan 13, 2021
@arshaw arshaw added this to the upcoming-release milestone Jan 13, 2021
@divya-sk-tfs-zz
Copy link
Author

Hi,

thanks for the update, after addition of default event content, we cannot see the error,

but we have some logic written in dayCellDidMount in month view, and we see some dates are not called in dayCellDidMount in month view, when switched from week view to month view
opened a new ticket regarding this issue

#6089

can u please look into this.

@arshaw arshaw removed this from the upcoming-release milestone Jan 15, 2021
@arshaw
Copy link
Member

arshaw commented Jul 22, 2021

reproduced. update repro.

@arshaw arshaw added this to the upcoming-release milestone Jul 22, 2021
@arshaw arshaw closed this as completed in 33f1881 Jul 27, 2021
@arshaw arshaw modified the milestones: v5.9.0, next-release Jul 28, 2021
@arshaw
Copy link
Member

arshaw commented Jul 28, 2021

I thought I fixed this in 5.9.0 ... (updated repro) ...

But as you can see in the new repro the content from one view makes its way into the other (along with some DOM mangling). I will fix in the next release.

@arshaw arshaw reopened this Jul 28, 2021
@vladdnepr
Copy link

Confirmed. After update to 5.9 I cant reproduce bug. All is OK

@arshaw arshaw modified the milestones: next-release, v5.10.0, a11y-soon Oct 13, 2021
@arshaw
Copy link
Member

arshaw commented Oct 13, 2021

I fixed the JS error from happening back in July with v5.9.0, however, the domNodes were still not cleared when switching views.

v5.10.0 fixes the entire problem.

Updated repro: https://codepen.io/arshaw/pen/XWRENao?editors=0010

@arshaw arshaw closed this as completed Oct 13, 2021
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

4 participants