Skip to content
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

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Jul 4, 2024

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

  • Open the ProgressBar component in storybook
  • Verify indeterminate mode works well with LTR and RTL
  • Change the value 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

@tyxla tyxla added [Type] Enhancement A suggestion for improvement. Internationalization (i18n) Issues or PRs related to internationalization efforts [Package] Components /packages/components labels Jul 4, 2024
@tyxla tyxla requested a review from a team July 4, 2024 13:39
@tyxla tyxla self-assigned this Jul 4, 2024
@tyxla tyxla requested a review from ajitbohra as a code owner July 4, 2024 13:39
Copy link

github-actions bot commented Jul 4, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@mirka mirka left a 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() ),
Copy link
Contributor

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!

Copy link
Member Author

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.

@tyxla tyxla merged commit b21a807 into trunk Jul 4, 2024
64 checks passed
@tyxla tyxla deleted the fix/rtl-progress-bar branch July 4, 2024 14:17
@github-actions github-actions bot added this to the Gutenberg 18.8 milestone Jul 4, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jul 18, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants