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

[BUG] - datepicker calendarProps classnames don't apply #3872

Closed
hruiz13 opened this issue Oct 11, 2024 · 2 comments
Closed

[BUG] - datepicker calendarProps classnames don't apply #3872

hruiz13 opened this issue Oct 11, 2024 · 2 comments

Comments

@hruiz13
Copy link

hruiz13 commented Oct 11, 2024

NextUI Version

2.4.8

Describe the bug

When I want to apply a className to the calendar within the datePicker, the original design is damaged, and the classNames that are added do not work.


import { Card, CardBody, DatePicker } from "@nextui-org/react";

export default function Home() {
  return (
    <Card className="mx-auto mt-4 max-w-md">
      <CardBody className="text-center">
        <h1 className="text-5xl">Date picker test</h1>
        <p className="text-xl">
          <DatePicker
            hideTimeZone
            showMonthAndYearPickers
            calendarProps={{
              content: "bg-primary",
              tw: "bg-primary text-white",
              navButtonProps: {
                //className: "text-red-500", // <- if uncommment this, all styles fails
              },
              color: "secondary",
              classNames: {
                headerWrapper: ["bg-transparent"],
                gridWrapper: ["bg-primary"],
                pickerWrapper: ["bg-primary"],
                nextButton: "text-red-500", // <- This do not work
              },
              buttonPickerProps: {
                color: "secondary",
                style: {},
                variant: "solid",
                //className: "text-white", // <- if uncommment this, all styles fails
              },
            }}
          />
        </p>
      </CardBody>
    </Card>
  );
}

image
image

Your Example Website or App

https://codesandbox.io/p/devbox/elated-khayyam-9nkpz3?workspaceId=809e93b8-69d3-49b4-b28e-5ff7a616bda9

Steps to Reproduce the Bug or Issue

  1. add classNames on calendarProps of DatePicker

Expected behavior

Apply the classNames

Screenshots or Videos

No response

Operating System Version

macOs

Browser

Chrome

Copy link

linear bot commented Oct 11, 2024

@wingkwong
Copy link
Member

calendarProps is not propagated correctly to the calendar and has been resolved in this PR. You may use canary version or wait for the next release.

@wingkwong wingkwong closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants