fix(calendar): mirror month navigation chevrons in RTL#3482
Open
AKnassa wants to merge 1 commit into
Open
Conversation
Under dir="rtl" the flex header swaps the nav buttons' visual sides but the hardcoded chevronLeft/chevronRight glyphs kept pointing inward at the month label. Mirror them with a CSS-only StyleX conditional transform (scaleX(-1) keyed on ':is([dir="rtl"] *)', same pattern as MobileNav) on a wrapper span — Icon's string mode clobbers caller classNames, so the style cannot go on Icon itself. DOM order, labels, and handlers unchanged; also fixes the embedded calendars in DateInput, DateRangeInput, and DateTimeInput.
|
@AKnassa is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Makes the calendar's month arrows point the right way for right-to-left languages (Arabic, Hebrew). Before, both arrows pointed inward at the month name; now they point outward, the way every calendar should.
Why
Anyone using the calendar in an RTL page saw backwards-looking arrows — confusing, and it made the product feel broken in those languages.
Fixes #3388
What changed
How to see it
Run Storybook and open Core/Calendar → RTL: the header should read
‹ January 2026 ›with "Previous month" on the right. Compare with the Default story to confirm left-to-right looks exactly as before.Good to know (scope)
dir="rtl"attribute (the same trade-off MobileNav made). Setting only the CSSdirectionproperty won't trigger it.