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

bug(mat-progress-bar): Using dir="rtl" does not work correctly #28572

Closed
1 task done
vincentsels opened this issue Feb 10, 2024 · 2 comments · Fixed by #28576
Closed
1 task done

bug(mat-progress-bar): Using dir="rtl" does not work correctly #28572

vincentsels opened this issue Feb 10, 2024 · 2 comments · Fixed by #28576
Assignees
Labels
area: material/progress-bar P4 A relatively minor issue that is not relevant to core functions

Comments

@vincentsels
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Adding dir="rtl" to a <mat-progress-bar> used to flip the direction to right-to-left. This currently doesn't work anymore. The result seems something random:

image

(note that explicitly setting dir="ltr" does work correctly)

This was already fixed once in 2021, but seems to be broken since then: #22705

Reproduction

StackBlitz link: https://stackblitz.com/edit/wnrmdf?file=src%2Fexample%2Fprogress-bar-determinate-example.html

Expected Behavior

The progress bar is displayed from right to left.

Actual Behavior

The progress bar is filled in somewhere in the middle, seemingly randomly.

Environment

  • Angular: 17.0.0
  • CDK/Material: 17.0.3
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@vincentsels vincentsels added the needs triage This issue needs to be triaged by the team label Feb 10, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 12, 2024
…n element

Fixes an issue where the progress bar was looking for `dir="rtl"` only on parent elements, but on itself. We can avoid the problem altogether by using a directionality-agnostic property.

Fixes angular#28572.
@crisbeto crisbeto self-assigned this Feb 12, 2024
@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions area: material/progress-bar and removed needs triage This issue needs to be triaged by the team labels Feb 12, 2024
@crisbeto
Copy link
Member

I've sent a fix in #28576, but you can also resolve it by putting the dir on a parent element.

crisbeto added a commit that referenced this issue Feb 12, 2024
…n element

Fixes an issue where the progress bar was looking for `dir="rtl"` only on parent elements, but on itself. We can avoid the problem altogether by using a directionality-agnostic property.

Fixes #28572.
crisbeto added a commit that referenced this issue Feb 12, 2024
…n element

Fixes an issue where the progress bar was looking for `dir="rtl"` only on parent elements, but on itself. We can avoid the problem altogether by using a directionality-agnostic property.

Fixes #28572.

(cherry picked from commit d0618bc)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/progress-bar P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants