-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(calendar): rtl navigation #4565
base: canary
Are you sure you want to change the base?
fix(calendar): rtl navigation #4565
Conversation
🦋 Changeset detectedLatest commit: 00f1750 The changes in this PR will be included in the next version bump. 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 |
@MarufSharifi is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe pull request introduces localization support to the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/components/calendar/src/calendar-base.tsx (1)
66-66
: Fix typo in variable name.The variable name
isLRT
contains a typo and should beisLTR
(Left-To-Right).- const isLRT = localeDirection === "ltr"; + const isLTR = localeDirection === "ltr";
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/components/calendar/src/calendar-base.tsx
(3 hunks)
🔇 Additional comments (2)
packages/components/calendar/src/calendar-base.tsx (2)
12-12
: LGTM! Good choice of i18n hook.The addition of
useLocale
from@react-aria/i18n
is appropriate for implementing RTL support.
75-81
: Well-implemented RTL navigation logic!The implementation correctly handles:
- Button behavior swapping for RTL mode
- Visual ordering through CSS classes
- Animation direction preservation
- Accessibility through ARIA props
However, let's verify the RTL behavior across different locales:
Also applies to: 94-100
20a888e
to
26b2921
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add changeset
… in the RTL calendar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.changeset/cyan-deers-tap.md (1)
5-5
: Consider enhancing the changeset description.While the current description is clear, consider adding:
- Which RTL locales were tested (e.g., Persian/fa)
- Confirmation that LTR layouts remain unaffected
- Any testing steps or scenarios verified
-Fixed reversed navigation behavior of nextButton and prevButton in the RTL calendar. The buttons now correctly navigate to the next and previous months, ensuring consistent behavior across all locales and layouts. (#4541) +Fixed reversed navigation behavior of nextButton and prevButton in the RTL calendar, particularly affecting Persian (fa) locale. The buttons now correctly navigate to the next and previous months, ensuring consistent behavior across RTL layouts while maintaining existing LTR functionality. Tested with Persian and Arabic locales. (#4541)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.changeset/cyan-deers-tap.md
(1 hunks)
🔇 Additional comments (1)
.changeset/cyan-deers-tap.md (1)
1-3
: LGTM! Version bump is appropriate.The patch version bump is correct for this bug fix, following semantic versioning principles.
@wingkwong changeset added |
Closes #4541
📝 Description
Fixed the reverse behavior of calendar navigation in a RTL Layout.
⛳️ Current behavior (updates)
Reversed Next and Previous Button Behavior in Persian Locale (fa) with Calendar
🚀 New behavior
Fixed the reverse Next and Previous button behavior in RTL Calendar
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
New Features
Bug Fixes
Accessibility