-
Notifications
You must be signed in to change notification settings - Fork 6.8k
bug(sidenav): Support changing direction (RTL/LTR) in Drawer, without force reload page. #33049
Copy link
Copy link
Open
Labels
area: material/sidenavgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by geminineeds triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team
Description
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
Apply to: a drawer with mode="side"
Changing page direction between LTR/RTL dynamically, would cause mat-drawer-content to render incorrectly (wrong margin).
I believe replacing margin-right / margin-left with margin-inline-end / margin-inline-start in the following lines would fix the issue.
components/src/material/sidenav/drawer.ts
Line 88 in 046e1a2
| '[style.margin-left.px]': '_container._contentMargins.left', |
Reproduction
- change direction to rtl dynamically ,or using dev tools. (in the example, i used setTimeout)
- open drawer => you'll see margin is applied to wrong side
Expected Behavior
- drawer should open from left/right according to document direction
- content should have correct margin depends on start/end or RTL/LTR
Actual Behavior
margin is applied to wrong side for drawer-content
Environment
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: material/sidenavgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by geminineeds triageThis issue needs to be triaged by the teamThis issue needs to be triaged by the team