-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
ProgressBar: Fix indeterminate RTL support #63129
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
I never thought of this 😱 Good one!
@@ -67,7 +76,7 @@ export const Indicator = styled.div< { | |||
animationDuration: '1.5s', | |||
animationTimingFunction: 'ease-in-out', | |||
animationIterationCount: 'infinite', | |||
animationName: animateProgressBar, | |||
animationName: animateProgressBar( isRTL() ), |
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.
I don't think I've ever thought of using the isRTL()
check directly in the styled components, I always used it in the render function and passed it as a prop. Interesting!
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.
It felt simpler to me, rather than having to introduce yet another prop. I'm happy to consider changing it if you feel it can be improved.
* ProgressBar: Fix indeterminate RTL support * CHANGELOG Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
What?
Fix the RTL support for the indeterminate
ProgressBar
component.Why?
Currently on RTL, the indeterminate progress bar animates from left to right.
How?
By parametrizing the animation by direction and taking it into account.
Testing Instructions
ProgressBar
component in storybookvalue
and verify determinate mode also works well in LTR and RTL.Testing Instructions for Keyboard
None
Screenshots or screencast
Before:
Screen.Recording.2024-07-04.at.16.31.29.mov
After:
Screen.Recording.2024-07-04.at.16.29.55.mov