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

Resource rows don't adjust height to fit resourceLaneContent #6103

Open
tkgwheeler opened this issue Jan 19, 2021 · 8 comments
Open

Resource rows don't adjust height to fit resourceLaneContent #6103

tkgwheeler opened this issue Jan 19, 2021 · 8 comments

Comments

@tkgwheeler
Copy link

Reduced Test Case

REDUCED TEST CASE

Bug Description

The lane height calculation is not taking your custom content into account when you use the resourceLaneContent hook. In my case I'm trying to display custom content (per resource) on the timeline above the events.

Expected results

The resource lane height (in the resource area and timeline section) would take the height of this new custom content into account.

Actual results

The height of your custom content is not taken into account, and therefore it's highly likely that your events will begin to overlap the lanes

fcResourceLaneHeightIssue

@acerix acerix changed the title Resource Timeline doesn't adjust lane heights for any content injected via resourceLaneContent hook Resource rows don't adjust height to fit resourceLaneContent Jan 25, 2021
@acerix
Copy link
Member

acerix commented Jan 25, 2021

Thanks, confirmed. Also get the same without React:

https://codepen.io/acerix/pen/yLadWXQ?editors=001

@arshaw
Copy link
Member

arshaw commented Mar 25, 2021

I suppose I didn't think through all the implications of resourceLaneContent before implementing it. Can I ask for more info about your usecase @tkgwheeler ? For the content you're injecting, are you hoping it goes behind each row's events, above each row's events, or below each row's events?

@arshaw arshaw removed this from the upcoming-release milestone Mar 25, 2021
@airzhanglin
Copy link

Reduced Test Case

REDUCED TEST CASE

Bug Description

The lane height calculation is not taking your custom content into account when you use the resourceLaneContent hook. In my case I'm trying to display custom content (per resource) on the timeline above the events.

Expected results

The resource lane height (in the resource area and timeline section) would take the height of this new custom content into account.

Actual results

The height of your custom content is not taken into account, and therefore it's highly likely that your events will begin to overlap the lanes

fcResourceLaneHeightIssue

Hello, I would like to ask why you added the custom content of Test. This content will only appear in the 12AM column, and the custom content will not be added after 12AM

@ecnaidar
Copy link

ecnaidar commented Apr 2, 2022

Hi, I am not sure if that is the same issue but I was looking for existing open issues with Resource height and found it.
We only use custom content inside of event harness provided by eventContent lifecycle hook and there is issues when changing view e.g. in example switching between week and month.

It does not seem to be adjusting resource height correctly and keeps previous value. If window size is changed everything resizes to correct heights and no overlapping occurs.

I tried forcing calendar.updateSize() within different view/event lifecycle hooks but to no avail.

Screen.Recording.2022-03-22.at.21.01.55.mov

@showduhtung
Copy link

showduhtung commented Jul 3, 2023

I am also facing this issue, when transitioning from view to view, it seems to default the resourceLane height to something default, but if I maneuver the calendar slightly like scrolling, (possibly creating a rerender somewhere), it adjusts but that's not a user behavior that's acceptable to me.
2023-07-03 17 53 42

      eventContent={({ event }) => {
          const { title, extendedProps } = event;
          return (
            <>
              <Text fw="bold">{title}</Text>
              <Text>{extendedProps.description}</Text>
            </>
          );
        }}

@ecnaidar were you able to solve this issue?

@ecnaidar
Copy link

Hey @showduhtung, saw you post during vacation and just now remembered that I haven't replied 😬

Yeah, we had a back and forth with FullCalendar support with attempts of reproducing it and it seemed that I have found a fix at the time

After quite a long time fiddling with that bug, I have figured it out. It is some weird behaviour when both 'resources' and 'events' arrays and objects are updated simultaneously. In the actual project those were reconstructed in a single 'useMemo' after a new date range was set and data was fetched. I have moved out 'resources' and the bug has disappeared. Tried replicating that in CodeSandbox so that it could be troubleshooted further but wasn't able to do it.

@AngelZacarias
Copy link

I'm facing the same issue than @ecnaidar, is there some workaround or is it related with this resourceLaneContent issue? 🤔

@arshaw arshaw moved this to In Progress in FullCalendar Planning Sep 30, 2024
@arshaw arshaw added this to the v7 milestone Sep 30, 2024
@arshaw
Copy link
Member

arshaw commented Oct 1, 2024

I've addressed this in v7.0.0-beta.0

Updated (vanilla-js only) repro:
https://codepen.io/arshaw/pen/dyxGZKW?editors=0010

Will work with the beta version of @fullcalendar/react

@arshaw arshaw moved this from In Progress to Staged in FullCalendar Planning Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Staged
Development

No branches or pull requests

7 participants