fix(date-range-picker): fixed input overflow
Closes #3037
📝 Description
When the component was on mobile screen, its contents were overflowing.
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
If the PR gets accepted please use my GitHub email-id ([email protected]) instead of my other email-id for the Co-authored-by: message.
Summary by CodeRabbit
-
Style
- Improved layout stability in the date range picker by adding
flexShrink: 0. - Enhanced date input component by applying
overflow-hiddento prevent content overflow.
- Improved layout stability in the date range picker by adding
-
Bug Fixes
- Fixed input overflow issue in the date range picker component.
🦋 Changeset detected
Latest commit: d191b823b1de2cedd650c0a6a326f9e20f03ac92
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @nextui-org/date-picker | Patch |
| @nextui-org/react | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| nextui-docs-v2 | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 4, 2024 6:07am |
| nextui-storybook-v2 | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 4, 2024 6:07am |
Someone is attempting to deploy a commit to the NextUI Inc Team on Vercel.
A member of the Team first needs to authorize it.
Walkthrough
This update primarily addresses layout issues with the date-range-picker and date-input components in the @nextui-org/date-picker package. The key changes include the addition of a classNames property to the useDateRangePicker function for enhanced styling customization and the addition of overflow-hidden to the dateInput component's base and input styles to manage overflowing content effectively, especially on small screens.
Changes
| File Path | Change Summary |
|---|---|
packages/components/date-picker/src/use-date-range-picker.ts |
Added an optional classNames property for styling customization and updated getStartDateInputProps to include flexShrink: 0. |
packages/core/theme/src/components/date-input.ts |
Added overflow-hidden to the base and input styles to handle text overflow within the component. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Prevent overflow in the date-range-picker on mobile (##3037) |
✅ | |
Ensure text truncation within the date-range-picker on small screens (##3037) |
✅ | |
Apply overflow-hidden to manage text overflow in dateInput component (##3037) |
✅ |
Possibly related PRs
-
#3011: This PR modifies the
useDateRangePickerfunction, which is directly related to the changes made in the main PR regarding theuseDateRangePickercomponent. -
#3258: This PR updates the
classNameshandling in theuseDateRangePicker, which aligns with the main PR's focus on enhancing class name customization. -
#3773: This PR ensures that
classNamesfromcalendarPropsare correctly propagated, which is relevant to the main PR's changes that enhance styling flexibility through theclassNamesproperty.
Suggested reviewers
- wingkwong
- jrgarciadev
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.