bug(MatFormField): Outline form field with prefix labels misalign when the document direction is changed.
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- angular, typescript
- Lĩnh vực
- frontend, internationalization
Hướng nghiên cứu
Bắt đầu với bản tái hiện StackBlitz được liên kết và kiểm tra implementation của Angular Material MatFormField liên quan đến các nhãn outline và prefix. Chuyển đổi hướng của document mà không render lại, sau đó so sánh behavior sau khi render lại; hoàn thành khi nhãn vẫn được căn chỉnh chính xác lúc chuyển đổi giữa LTR và RTL.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 the direction property on the document is changed (LTR to RTL and viceversa), outline form fields with a prefix suffer from label misalignment. This presents a problem for apps that have forms and need to support a location switcher that has a RTL language like Arabic.
Reproduction
StackBlitz link: https://stackblitz.com/edit/3rswucyt?file=src%2Fexample%2Fform-field-appearance-example.html
Steps to reproduce:
- Observe button in default LTR mode.
- Click the "Toggle dir" button to change the direction in the wrapper to RTL
- Observe the label is now misaligned, trailing off to the right.
- Click the "Rerender" button to remove the form from the dom for one second
- Observe that when the component re-renders, the label alignment is correct.
- Click the "Toggle dir" button again to set the direction back to LTR
- Observe the label is misaligned again, only fixes when re-rendering the button.
Expected Behavior
When changing the direction, the label alignment should react and adjust.
Actual Behavior
The label is not aligning, it seems that it has the calculation obtained from before the direction changed. Since re-rendering the component fixes the problem, it appears that the logic is inside the component, but there is no way to notify the component a re-calculation is needed.
Environment
- Angular: 22.1.0
- CDK/Material: 22.1.0
- Browser(s): Google Chrome, Microsoft Edge, Safari
- Operating System (e.g. Windows, macOS, Ubuntu): MacOS
- Ngôn ngữ chính
- TypeScript
- Star
- 25k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 92
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của angular/components
-
area: material/datepicker P4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
angular/components#33763 · 2 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: material/table P4
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
angular/components#33709 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: material/table docs gemini-triaged P4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
angular/components#33455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: material/core gemini-triaged P3
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
angular/components#33059 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: material/dialog P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
angular/components#30536 · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của angular/components
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
diegosouzapw/OmniRoute#14869 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
Maintainer thường phản hồi trong vòng 1 ngày
-
status: waiting triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
freeCodeCamp/freeCodeCamp#70412 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
opensearch-project/OpenSearch-Dashboards#12816 ·
Maintainer thường phản hồi trong vòng 1 ngày