🙋 Documentation Request
Consider the following bit of code for the Tailwind CSS docs on DateField:
|
<AriaDateInput className={renderProps => fieldGroupStyles({...renderProps, class: 'inline min-w-[150px] px-3 h-9 text-sm leading-8.5 font-sans cursor-text disabled:cursor-default whitespace-nowrap overflow-x-auto [scrollbar-width:none]'})} {...props}> |
export function DateInput(props: Omit<DateInputProps, 'children'>) {
return (
<AriaDateInput className={renderProps => fieldGroupStyles({...renderProps, class: 'inline min-w-[150px] px-3 h-9 text-sm leading-8.5 font-sans cursor-text disabled:cursor-default whitespace-nowrap overflow-x-auto [scrollbar-width:none]'})} {...props}>
...
Since className is used to set fieldGroupStyles and {...props} follows it, the className will be overwritten if set on DateInput. Setting the classname for Dateinput is shown in DatePicker: https://react-aria.adobe.com/DatePicker
I think the change to fix this would be something like:
export function DateInput(props: Omit<DateInputProps, 'children'>) {
return (
<AriaDateInput {...props} className={composeRenderProps(props.className, (className, renderProps) => fieldGroupStyles({...renderProps, class: cn('inline min-w-[150px] px-3 h-9 text-sm leading-8.5 font-sans cursor-text disabled:cursor-default whitespace-nowrap overflow-x-auto [scrollbar-width:none]', className) }) )}>
...
or just to make a new variant in tailwind-variants that extends fieldGroupStyles
🧢 Your Company/Team
No response
🙋 Documentation Request
Consider the following bit of code for the Tailwind CSS docs on DateField:
react-spectrum/starters/tailwind/src/DateField.tsx
Line 52 in 9c28234
Since className is used to set fieldGroupStyles and {...props} follows it, the className will be overwritten if set on DateInput. Setting the classname for Dateinput is shown in DatePicker: https://react-aria.adobe.com/DatePicker
I think the change to fix this would be something like:
or just to make a new variant in tailwind-variants that extends fieldGroupStyles
🧢 Your Company/Team
No response