Components: RTL documentation missing

Created on 4 May 2017  路  10Comments  路  Source: angular/components

Breaking of #4367:

proposal:

RTL support exists but I could find how to use it in the documentation, I found an issue, linked to a changeset leading to the relevant code.

docs feature help wanted

Most helpful comment

@HarelM @DevVersion well, i think the basic assumption is that it works out of the box, we can use a guide that says use dir="rtl" on html/body and automatically all the components will support it

All 10 comments

I think a guide in the guides/ folder would be enough. cc. @EladBezalel

@HarelM @DevVersion well, i think the basic assumption is that it works out of the box, we can use a guide that says use dir="rtl" on html/body and automatically all the components will support it

True, but material 2 also supports dynamic content direction change using [dir]=... which is a great feature that IMHO deserves a guide/page/paragraph somewhere.

Yeah I agree that we should briefly mention that RTL support is there & how you could use it.

Also important to mention is that RTL mode doesn't work when specifying the direction from CSS.

@EladBezalel @DevVersion Well, I tried to add dir="rtl" on html and most of the components appear as expected, but when I opened a dialog it still had dir="ltr" on the cdk-overlay-pane, which means that unfortunately not _all_ the components support it. It seems that we still have to manually set the MdDialogConfig.direction which is undocumented, and defaults to "ltr", I think that it should be possible not to specify the direction and to get whatever is specified on the near parent, which is probably would be html/body. Also I believe that there should be an option to dynamically change the direction of the whole page(switching dir on html/body), and not only of a part of the DOM using [dir]=....

I use a variable on a service so that I can change it in one place to change all the components.
I manually add direction to all dialogs to support this, since they are not part if the "main" DOM it didn't feel weird to me.

Then, at least, it has to be well documented, currently there is no a single word about this property on the API reference page,

When #4044 will get in it would support html/body, I agree we should address RTL on the docs.. next thing to do!

@jelbourn By the way, as per W3 https://www.w3.org/International/tutorials/bidi-xhtml/

Add a dir attribute to the html tag to set the default base direction of your page if it is right-to-left. Use the dir attribute on block elements within the page _only_ where you need to change the base direction.

So in my, maybe not so humble, opinion, MdDialogConfig.direction, as well as the overlayState.direction, should _not_ have a default value...

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

alanpurple picture alanpurple  路  3Comments

kara picture kara  路  3Comments

Hiblton picture Hiblton  路  3Comments

crutchcorn picture crutchcorn  路  3Comments

LoganDupont picture LoganDupont  路  3Comments