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

Checkbox problem in RTL on scrolling page #1062

Closed
darkpey opened this issue Aug 17, 2016 · 6 comments
Closed

Checkbox problem in RTL on scrolling page #1062

darkpey opened this issue Aug 17, 2016 · 6 comments
Labels
help wanted The team would appreciate a PR from the community to address this issue i18n This issue is related to internationalization P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@darkpey
Copy link

darkpey commented Aug 17, 2016

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.

@darkpey darkpey changed the title Checkbox problem in RTL Checkbox problem in RTL on scrolled page Aug 17, 2016
@darkpey darkpey changed the title Checkbox problem in RTL on scrolled page Checkbox problem in RTL on scrolling page Aug 17, 2016
@jelbourn jelbourn added i18n This issue is related to internationalization help wanted The team would appreciate a PR from the community to address this issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Aug 17, 2016
@devversion
Copy link
Member

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.

@darkpey
Copy link
Author

darkpey commented Aug 18, 2016

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>

@eladh
Copy link

eladh commented Mar 15, 2017

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

see - example

@EladBezalel
#goodnessSquad

@EladBezalel
Copy link
Member

@eladh Thanks !

@darkpey
Copy link
Author

darkpey commented Mar 16, 2017

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

@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 Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted The team would appreciate a PR from the community to address this issue i18n This issue is related to internationalization P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants