-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Mat-form-field outline rendered incorrectly when direction='rtl' #18857
Mat-form-field outline rendered incorrectly when direction='rtl' #18857
Comments
In general Material components don't respond to the CSS |
Thank you for your speedy reply. |
The example you linked is the same as the original one, but here's something that works: https://stackblitz.com/edit/angular-vwwrbm-dtrw7y |
I've managed to reproduce the problem in your example. The problem is that if the [dir] receives only a string and not a expression the initial outline is not rendered correctly. https://stackblitz.com/edit/angular-vwwrbm-srpxkk LATER EDIT: The bug also reproduces if you choose to start with rtl in the [dir] expression tag, like so: https://stackblitz.com/edit/angular-vwwrbm-ez6q1q |
…ence of a prefix The logic that figures out the outline gap in the presence of a prefix was producing a negative width which is invalid. It seems like this has been there since the beginning, but we haven't noticed it, because our dev app doesn't have many examples with a prefix and it always starts off from LTR and we switch it to RTL manually which doesn't have this problem since it already got a valid width while it was in LTR. Fixes angular#18857.
Thank you, now I see it. We have an incorrect calculation that I've fixed in #18867. |
…ence of a prefix The logic that figures out the outline gap in the presence of a prefix was producing a negative width which is invalid. It seems like this has been there since the beginning, but we haven't noticed it, because our dev app doesn't have many examples with a prefix and it always starts off from LTR and we switch it to RTL manually which doesn't have this problem since it already got a valid width while it was in LTR. Fixes angular#18857.
…ence of a prefix (#18867) The logic that figures out the outline gap in the presence of a prefix was producing a negative width which is invalid. It seems like this has been there since the beginning, but we haven't noticed it, because our dev app doesn't have many examples with a prefix and it always starts off from LTR and we switch it to RTL manually which doesn't have this problem since it already got a valid width while it was in LTR. Fixes #18857.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
What's the bug:
When changing the direction of a matFormField, the outline gap doesn't render correctly.
Steps to reproduce:
or
See https://stackblitz.com/edit/angular-vwwrbm-8xrx3b
Expected Behavior
I was expecting the outline and its label to be rendered correctly, even with the prefix and suffix labels inside the mat-form-field.
Actual Behavior
When changing the direction of a mat-form-field, the outline gap doesn't render correctly, there's a gap where the mat-label should be. Also this is affected by having a prefix inside the mat-form-field, somehow the prefix's width decrements the outline label left positioning instead of increasing it.
Also the outline itself of the mat-form-file is not rendered correctly.
Also the MatFormField updateOutlineGap() doesn't update the material correctly, when the direction is rtl. I'm calling updateOutlineGap everytime the direction changes, ltr works ok but rtl is out of place.
Environment
The text was updated successfully, but these errors were encountered: