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(MatList): Icons do not respect RTL direction #30537

Open
1 task
withpouriya opened this issue Feb 23, 2025 · 2 comments
Open
1 task

bug(MatList): Icons do not respect RTL direction #30537

withpouriya opened this issue Feb 23, 2025 · 2 comments
Labels
area: material/list needs: clarification The issue does not contain enough information for the team to determine if it is a real bug

Comments

@withpouriya
Copy link

withpouriya commented Feb 23, 2025

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

When using MatList in an RTL project, the icons do not adjust their margins correctly based on the text direction (dir="rtl"). The left and right margins remain the same as in LTR mode, causing misalignment in RTL layouts.

I was able to fix this issue easily with custom CSS, but I wanted to report it as a bug in case it needs to be addressed in the library.

Reproduction

StackBlitz link:
Steps to reproduce:
1.
2.

Expected Behavior

Icons should switch their margins correctly when dir="rtl" is set.

Actual Behavior

Icons remain aligned as if the project is LTR, leading to incorrect spacing.

Environment

Angular: 18
Angular Material: 19.1.5
Browser: Latest version of Chrome
Operating System: Windows (running a Linux dev container on WSL)

@withpouriya withpouriya added the needs triage This issue needs to be triaged by the team label Feb 23, 2025
@crisbeto
Copy link
Member

This isn't enough information to investigate. Can you show what your markup looks like?

@wagnermaciel wagnermaciel added needs: clarification The issue does not contain enough information for the team to determine if it is a real bug area: material/list and removed needs triage This issue needs to be triaged by the team labels Feb 24, 2025
@withpouriya
Copy link
Author

Image
Sure! As you can see in this image, the default padding of mat-icon in the list is more on the left side than on the right, whereas for RTL, it should be the opposite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/list needs: clarification The issue does not contain enough information for the team to determine if it is a real bug
Projects
None yet
Development

No branches or pull requests

3 participants