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(tabs): Material Tabs ink bar moves to the wrong direction in RTL when drawer opens #25355

Closed
anisabboud opened this issue Jul 28, 2022 · 2 comments
Labels
area: material/tabs P4 A relatively minor issue that is not relevant to core functions

Comments

@anisabboud
Copy link

anisabboud commented Jul 28, 2022

Description

Tabs ink-bar moves to the wrong location in RTL, when toggling a drawer.

Watch the following GIF video, showing the entire code and behavior.

  1. First it shows how everything works well in LTR.
  2. Then it shows how switching dir to RTL makes the ink-bar jump incorrectly when toggling the drawer.

LTR+RTL ink-bar
StackBlitz: https://stackblitz.com/edit/components-issue-po9bzs?file=src%2Fapp%2Fexample-component.html

Reproduction

Steps to reproduce:

  1. Fork the official components StackBlitz: https://stackblitz.com/fork/components-issue
  2. Copy-paste the following code into example-component.html.
  3. Toggle the drawer, and watch the ink-bar's behavior. It jumps to the wrong location.
<mat-drawer-container dir="rtl">
  <mat-drawer #drawer mode="side" position="end">
    <p>Drawer content</p>
  </mat-drawer>

  <button mat-flat-button color="primary" (click)="drawer.toggle()">
    Click here (Toggle Drawer)
  </button>

  <mat-tab-group>
    <mat-tab label="First">Content 1</mat-tab>
    <mat-tab label="Second">Content 2</mat-tab>
    <mat-tab label="Third">Content 3</mat-tab>
  </mat-tab-group>
</mat-drawer-container>

Expected Behavior

ink-bar's position should be calculated differently when the document's direction is RTL.

Actual Behavior

ink-bar works well in LTR but not in RTL, when using drawers/sidenavs.

Environment

  • Angular: 14.1.0
  • CDK/Material: 14.1.0
  • Browser(s): Chrome 103
@anisabboud anisabboud added the needs triage This issue needs to be triaged by the team label Jul 28, 2022
@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions area: material/tabs Fixed in MDC and removed needs triage This issue needs to be triaged by the team labels Aug 11, 2022
@amysorto
Copy link
Contributor

amysorto commented May 7, 2024

This is fixed in the MDC based components (the default components now).

@amysorto amysorto closed this as completed May 7, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/tabs P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

3 participants