Components: Checkbox problem in RTL on scrolling page

Created on 17 Aug 2016  路  6Comments  路  Source: angular/components

RTL direction in css as below:

html {
   direction: rtl;
}

If vertical scrollbar visible on the page, checkbox border move to left:
capture
I have this problem with dir attribute on html tag also, thanks in advance.

P3 help wanted i18n

Most helpful comment

Hi @mbnsoft .
its seems working with the latest release.

see - example

@EladBezalel

goodnessSquad

All 6 comments

I just took a quick look at that issue.

At first I came up with a solution like

/**
 * Temporary mixin to detect whether the current selector is inside of an RTL direction.
 * This can be removed in the future when a service takes control over the RTL detection.
 */
@mixin if-rtl() {
  [style*="direction:rtl"] &, [dir='rtl'] & {
    @content;
  }
}

But that approach only works for the inline style of direction: rtl - So it's not the solution.

I think now would be a good point to consider creating the RTL service, which detects RTL from the computed style.

There must be some discussion about that, since computed style can damage the performance significant.

But the correct approach would be definitely using the computed style.

I thought about a directive, which will be applied to the components root element, and then toggles a class for RTL when the upper direction changed.

I found a solution, parent scroll container must set force overflow in css:

html {
   direction: rtl;
}

#container {
   overflow: auto;
}
<md-sidenav-layout fullscreen>
   <md-sidenav #sidenav mode="side" align="end" opened="true">
      ...
   </md-sidenav>
   <div id="container">
      ...
   </div>
</md-sidenav-layout>

Hi @mbnsoft .
its seems working with the latest release.

see - example

@EladBezalel

goodnessSquad

@eladh Thanks !

Hi @eladh
Yes it's works correctly, Thanks!

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeffbcross picture jeffbcross  路  126Comments

anderflash picture anderflash  路  59Comments

jelbourn picture jelbourn  路  132Comments

MariovanZeist picture MariovanZeist  路  59Comments

julianobrasil picture julianobrasil  路  78Comments