-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Change the week header and left button style to meet the date spacing #27730
Conversation
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.
This is awesome! Small, focused PR! Thank you. Before:
After:
The month navigation buttons have better alignment.
I'm seeing an issue in arabic, though:
The button to navigate left takes up the whole screen. This may have been a pre-existing issue, but because this PR aims to close the ticket that reported the issue, it seems worth fixing.
From a little debugging in the inspector, I found this rule:
.components-datetime__date .DayPickerNavigation_leftButton__horizontalDefault {
right: 13px;
}
If that gets changed to:
.components-datetime__date .DayPickerNavigation_leftButton__horizontalDefault {
left: 13px;
}
all is fine.
In other words, it appears that the left
and right
positioning gets auto-rewritten for RTL, when it shouldn't be. So in the code where it says left
, you can add the following line before it, to have it not be rewritten: /*rtl:ignore*/
.
If we get that in, we can ship this. Thanks again.
@jasmussen Thanks for the tip! The change has been pushed. |
@jasmussen Thank you! The begin/end ignore is a good addition! I've pushed that change. Could you confirm if you have pulled the latest changes and built the scripts? I see the arrows properly aligned in RTL without the need for |
Thanks again. I'm about to head out for the evening but promise I will test properly tomorrow morning my time, and approve if it works as I think it will. But in the mean time, someone else should feel free to test and approve. |
It looks like this PR may also resolve #27535. Also, I ran into another problem with the RTL calendar. The current month appears hidden because of the positioning of months in RTL mode. Do you see this issue? I think there's a quick fix for this by absolutely positioning the third calendar month in the container since we don't use calendar animations in GB, but this problem may be upstream in react dates. react-dates/react-dates#1552. |
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.
Thanks so much for this PR, and thanks for the patience. With the latest changes, this is solid in LTR:
And RTL:
Here's RTL before, for comparison:
That arabic calendar does look fairly compressed to me, though, so there may be a separeate bug at play, but since that existed before this PR it's unrelated. Admittedly my Arabic is a little rusty, so I'll defer to speakers of that language.
Ship this, and thanks again!
The pleasure is all mine 🤝 |
Description
Fix #27536
Change the week header and left button style to meet the date spacing.
How has this been tested?
Tested in English and in Arabic (rtl), both render as expected
Screenshots
1. After
Types of changes
Checklist: