-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Calendar: TypeScript Definitions do not match with actual PT props #6094
Comments
PR submitted. I had fixed this before and another commit later accidentally overwrote these changes |
Thanks. But are you sure that this will fix the problem? You just changed the default PT to match the typescript definitions, but the main problem is that the PTs I mentioned above are not respected by the calendar component, when written in the correct typescript-case. |
they should be. lets take the real code Calendar Typescript is
Calendar PassThrough PTM is primereact/components/lib/calendar/Calendar.js Lines 3054 to 3061 in 2e950d4
Finally now that Tailwind index will match that case and instead of being |
See this working example of |
Possible, because we merge the default props with our custom ones. Will try when the new version is out. Or can I test it somehow beforehand? |
you can probably do a local build with |
Thanks. I added a comment to the PR. However, I still don't understand the following behaviour: import { Calendar as PCalendar, type CalendarProps as PCalendarProps } from "primereact/calendar";
import TailwindDefaultPT from "primereact/passthrough/tailwind";
import InputDatePT from "./input-date-pt";
export const InputDate = (inputDateProps: PCalendarProps) => {
const props = { ...inputDateProps };
return <PCalendar unstyled pt={{ ...TailwindDefaultPT.calendar, ...InputDatePT }} {...props} />;
}; As you said, the component should take primereact/components/lib/calendar/Calendar.js Lines 3054 to 3061 in 2e950d4
However, when a |
So from my PR and looking at the code there is no lowercase Can you put together a Stack Blitz showing the issue? |
Fix #6094: Calendar Tailwdind Passthrough
Describe the bug
We noticed, that some PT props have to be written lowercase instead of camelCase that they work.
Specifically in calendar component:
previousbutton
)nextbutton
)tableheadercell
)weekday
)daylabel
)monthpicker
)yearpicker
)timepicker
)separatorcontainer
)hourpicker
)minutepicker
)ampmpicker
)incrementbutton
)decrementbutton
)groupcontainer
)In the passthrough provided directly in the repo (https://github.com/primefaces/primereact/blob/master/components/lib/passthrough/tailwind/index.js), the properties are the "correct" way (so that they work, but it's wrong for TypeScript), but in the docs not.
Reproducer
No response
PrimeReact version
10.5.1
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: