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 is not working as expected on mobile. Responsive is broken. #4032

Open
IsraelDCastro opened this issue Nov 11, 2024 · 4 comments

Comments

@IsraelDCastro
Copy link

NextUI Version

2.4.8

Describe the bug

The DatePicker component on mobile is out of the screen, creating a bad UX experience while using it. You can see the image to check it. The code of the component:

<DatePicker
          label="Arrival date"
          labelPlacement="outside"
          name="arrival_date"
          id="arrival_date"
          classNames={{
            calendar: "min-w-[300px]"
          }}
          visibleMonths={2}
          dateInputClassNames={{ input: "arrival-date-input" }}
          required
          color={errors.arrival_date && touched.arrival_date ? "danger" : ""}
          errorMessage={errors.arrival_date && touched.arrival_date && errors.arrival_date}
          isInvalid={errors.arrival_date && touched.arrival_date}
/>

Screenshot 2024-11-11 at 11 54 27 AM

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Use the DatePicker component with the prop: visibleMonths={2}

Expected behavior

As a user, I expected to see the DatePicker maybe in vertical responsive view or with horizontal scroll to get a better UX.

Screenshots or Videos

No response

Operating System Version

macOs

Browser

Chrome

@IsraelDCastro
Copy link
Author

IsraelDCastro commented Nov 12, 2024

@media only screen and (max-width: 768px) {
	div[data-slot="calendar"] {
		--calendar-width: 156px !important;
	}

	div[data-slot="grid-wrapper"] {
		@apply flex-col;
	}
}

I made this temporary fix, but it is not the best way to fix it.

Screenshot 2024-11-12 at 11 26 39 AM

@prudvinani
Copy link

@IsraelDCastro, hi! Could you please send me the exact router where you're facing the issue, so I can work on it?

@IsraelDCastro
Copy link
Author

@IsraelDCastro, hi! Could you please send me the exact router where you're facing the issue, so I can work on it?

@prudvinani I'm using "react-router-dom": "^6.26.0"

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