Skip to content

bug(sidenav): Support changing direction (RTL/LTR) in Drawer, without force reload page. #33049

@akram1905

Description

@akram1905

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.

'[style.margin-left.px]': '_container._contentMargins.left',

Reproduction

Example with settimeout

  1. change direction to rtl dynamically ,or using dev tools. (in the example, i used setTimeout)
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions