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

Setting resourceAreaHeaderContent overrides the value of headerContent is resource columns #7153

Closed
1 task done
tn-bouvet opened this issue Jan 17, 2023 · 4 comments
Closed
1 task done

Comments

@tn-bouvet
Copy link

Reduced Test Case

https://stackblitz.com/edit/github-6b7aj5?file=src/index.jsx

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

See stackblitz project. When resourceAreaHeaderContent is provided, the calendar overwrites the headerContent in the resourceAreaColumns prop.

Also, while the docs state that the default resource area header should be "Resources", no such header appears as long as resourceAreaColumns are defined.

I have checked without the React connector, and this seems to work in that case. See codepen.

Desired outcome (taken without react connector):
image

Result when resourceAreaHeaderContent is provided:
image

Result when resourceAreaHeaderContent is not provided:
image

@lukas-siarny
Copy link

lukas-siarny commented Jan 17, 2023

The cellContent with resourceAreaColumns also dosen't work correctly. It works when you return a string, but when you return JSX it renders nothing

I just added cellContent to the test case above:
This doesn't work:

          resourceAreaColumns={[
            { field: 'num', headerContent: () => 'Number' },
            { field: 'name', headerContent: 'Name', cellContent: () => <span>'cellContent'</span> },
          ]}

This works:

          resourceAreaColumns={[
            { field: 'num', headerContent: () => 'Number' },
            { field: 'name', headerContent: 'Name', cellContent: () => 'cellContent' },
          ]}

@acerix acerix changed the title Setting resourceAreaHeaderContent breaks headerContent Setting resourceAreaHeaderContent overrides the value of headerContent is resource columns Jan 20, 2023
@acerix
Copy link
Member

acerix commented Jan 21, 2023

Thanks, I can confirme this is a bug specfic to React.

Since resourceAreaHeaderContent is getting called for each header, as a workaround, you can add a counter and return the correct header content like this:

https://stackblitz.com/edit/github-6b7aj5-sgfkgx?file=src%2FDemoApp.jsx

@arshaw
Copy link
Member

arshaw commented Jan 22, 2023

Thanks for this bug report. I'll fix it and release it in a minor release before the end of next week (Jan 27). Sorry for the troubles.

@arshaw arshaw added this to the v6.0.4 milestone Jan 24, 2023
@arshaw
Copy link
Member

arshaw commented Jan 30, 2023

@arshaw arshaw closed this as completed Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants