fullcalendar: incorrect navLink for granularities other than day/week
Hi,
Using navLinks, the day header from resourceTimelineWeek links to resourceTimelineMonth (instead of expected resourceTimelineDay), even with explicit setting navLinkDayClick.
Test case: https://codepen.io/anon/pen/QPzLgo
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 11
- Comments: 15 (4 by maintainers)
Used
slotLabelDidMountworkaround for React implementation, thanks for thatNot going to lie, it kind of boggles my mind that this have been hanging on the wall for 3 years already. Especially since it is basic functionality that is broken exclusively in “premium” part of FullCalendar 🙃
The problem here is that the
navLink*Clickhandlers are called in more specific situations that you might think. For example,navLinkDayClickonly happens when a whole-day cell is clicked. The reason it’s not firing in the codepen is because an hour-granularity is being clicked (which would hypothetically need navLinkHourClick).We would need to improve the API to make this less awkward. I’ll propose
navLinkClick:Any idea when this will be resolved?
Thanks, confirmed. I also noticed the
navLinkDayClickcallback is not called when clicking a day header in the week view.https://codepen.io/anon/pen/JVVvQm?editors=0010
I was able to get it working using a combination of the solutions provided by acerix and wildhart:
For some reason, in my case, just replacing ‘month’ with ‘day’, worked fine, however it would revert back to month whenever I was filtering events and resources. As well, having the onclick event wrapped in a setTimeout() was causing a slight flicker where the month view was briefly shown before switching to the day view.
This workaround works for me: