You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kindly add support rtl to animation and the components
Copied from original issue: driftyco/ionic2#832
Reacted by alaa-alshamy, Alexander Trakhimenok, Paulo, Reza Haidari .A, SydAmir, Mahendra Soni, Rafal Smyka, Yaslam Badabood, Amit Moryossef, Doron Grinzaig and 2 more
Yes this is on our roadmap to complete and we would love to get more feedback from experienced RTL dev's to help us point out where we need to improve. Would you be able to provide a checklist of certain parts of ionic2 that do not work well with RTL. Our goal would be to provide an additional RTL css file, and have any JS adjust accordingly depending if the html element has dir="rtl" or not. Thanks
Reacted by alaa-alshamy, Alexander Trakhimenok, Reza Haidari .A, itamar and Shahar
It's my pleasure to help ionic2 team to support RTL
firest it's easy to watch what are the bad effects if we use rtl direction
we can add this attr to html tag that will convert all website to to rtl
or
we can use it in the body as a style like this
style="direction:rtl"
if ionic team plan to support rtl
thay will need to add the target direction in App configurations , because the application will need to know what is the direction on the start up
, and if the developer need to change the app language to rtl language in runtime then we should refresh all app (like native android,windows phone app , ios need to restart the application to change it's direction)
now when i try to change ionic2 html direction i found that there are things aleady support rtl direction coz pure html konw how to deal with rtl direction
but thare are things need to be support rtl direction
first thing is animation
i donn't know if ionic team do the animation with css or javascript code , in both cases all animation witch have rtl or ltr will need to add another animation direction , not only change varialbe but add another one coz many things will need to change
I would like to provide assistance as i can to ionic team to help in this great library
i know my English is not good , but i hope you understand my words :)
plz change this goal " Our goal would be to provide an additional RTL css file "
because we need the two direction in the same application , based on the user's choice , some time it will be in runtime
these imgs from trying to change direction of onic-conference-app example
if ionic team cover the rtl direction in this example i think it will be not less than 90% of rtl support
any icon which are right,left,back or forward arrow like back-button icon will need this style
{
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
So @brandyscarney had a good idea that we create all the RTL scss files within the repo and get them ready to be filled.
I was thinking that instead of dynamically adding another rtl css, we could have a default $rtl-support: false sass variable that can be updated in each app's sass variables. So in most cases the extra rtl css wouldn't be added to apps, but for those who require the rtl css they can set $rtl-support: true.
Then within our new rtl scss files, the css can be wrapped with @if $rtl-support. This way we can keep the css files separated and easier to edit, and provide rtl support out of the box. Think this will work @mashaly100200 ?
let us start with animation , coz it may be need more effort
i want to know is it possible to add specific page transition animation when do push and pop pages ?
and how developer add this specific animation to the tow pages witch enter and leave ?
can developer watch back event then add his specific animation also to the two pages ?
if your answer are yes for the previous three questions , then i can congratulate my self coz animation topic don't need any effort and full support rtl direction and ionic team deserve a very big thanks :)
@joesleiman
for now, I use material design page transition only, which is an alternative to avoid page transition from left to right.
// in app.module.ts..imports: [BrowserModule,IonicModule.forRoot(MyApp,{pageTransition: 'md-transition'// change the page Transition to avoid "LRT" page Transition })..
@joesleiman No, having dir="rtl" on ion-content is not guaranteeing support. You should always use this.platform.setDir('rtl', true) and remove all of the dir attributes except the one in the html tag. It also controls direction of ionic components from typescript, such as gestures. (note that setDir with true also updates the html tag with the correct dir)
About the back button, if you use the proper way to set direction, as mentioned above, it will flip your arrows, as done here - #11634. It is only available in the nightly version, and a new version (3.3.0) will be released later today.
I ask again, please, for these kind of support questions use the forum. Github is for bugs/feature requests.
@AmitMY if the user put this.platform.setDir('rtl',true); and close the app and then return to it how can i save for html tag dir='rtl' . so isn't good idea to use it. because it return to dir="ltr"
@joesleiman So if your app is multidirectional, and you use the user preferences to decide which side, I would recommend using NativeStorage, and storing for the key "preferences" the object: {lang: "he", dir: "rtl"}, and then in app.component.ts on platform.ready check if the user has preferences. If he does, apply them by setDir.
I think you are not using the nightly version as I suggested (3.2.1-201705231529), and if you are using it, it is a case of overridden style, and it is fixed here #11635
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
mhartington commentedon Jan 18, 2016
From @adamdbradley on December 30, 2015 17:38
Yes this is on our roadmap to complete and we would love to get more feedback from experienced RTL dev's to help us point out where we need to improve. Would you be able to provide a checklist of certain parts of ionic2 that do not work well with RTL. Our goal would be to provide an additional RTL css file, and have any JS adjust accordingly depending if the html element has
dir="rtl"or not. Thanksmhartington commentedon Jan 18, 2016
From @mashaly100200 on December 30, 2015 18:39
It's my pleasure to help ionic2 team to support RTL
or we can use it in the body as a style like this style="direction:rtl"firest it's easy to watch what are the bad effects if we use rtl direction
we can add this attr to html tag that will convert all website to to rtl
if ionic team plan to support rtl
thay will need to add the target direction in App configurations , because the application will need to know what is the direction on the start up
, and if the developer need to change the app language to rtl language in runtime then we should refresh all app (like native android,windows phone app , ios need to restart the application to change it's direction)
now when i try to change ionic2 html direction i found that there are things aleady support rtl direction coz pure html konw how to deal with rtl direction
but thare are things need to be support rtl direction
first thing is animation
i donn't know if ionic team do the animation with css or javascript code , in both cases all animation witch have rtl or ltr will need to add another animation direction , not only change varialbe but add another one coz many things will need to change
I would like to provide assistance as i can to ionic team to help in this great library
i know my English is not good , but i hope you understand my words :)
mhartington commentedon Jan 18, 2016
From @mashaly100200 on December 30, 2015 18:44
plz change this goal " Our goal would be to provide an additional RTL css file "
because we need the two direction in the same application , based on the user's choice , some time it will be in runtime
mhartington commentedon Jan 18, 2016
From @adamdbradley on December 30, 2015 18:51
Ionic itself will be able to dynamically add this css file for you, depending on the
<html dir="rtl">mhartington commentedon Jan 18, 2016
From @mashaly100200 on December 30, 2015 19:23
these imgs from trying to change direction of onic-conference-app example
if ionic team cover the rtl direction in this example i think it will be not less than 90% of rtl support
mhartington commentedon Jan 18, 2016
From @mashaly100200 on December 30, 2015 19:26
mhartington commentedon Jan 18, 2016
From @mashaly100200 on December 30, 2015 19:27
mhartington commentedon Jan 18, 2016
From @mashaly100200 on December 30, 2015 20:21
any icon which are right,left,back or forward arrow like back-button icon will need this style
{
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
mhartington commentedon Jan 18, 2016
From @adamdbradley on December 31, 2015 4:27
So @brandyscarney had a good idea that we create all the RTL scss files within the repo and get them ready to be filled.
I was thinking that instead of dynamically adding another rtl css, we could have a default
$rtl-support: falsesass variable that can be updated in each app's sass variables. So in most cases the extra rtl css wouldn't be added to apps, but for those who require the rtl css they can set$rtl-support: true.Then within our new rtl scss files, the css can be wrapped with
@if $rtl-support. This way we can keep the css files separated and easier to edit, and provide rtl support out of the box. Think this will work @mashaly100200 ?mhartington commentedon Jan 18, 2016
From @mashaly100200 on December 31, 2015 11:48
yes load rtl dynamically is a good idea ,
let us start with animation , coz it may be need more effort
if your answer are yes for the previous three questions , then i can congratulate my self coz animation topic don't need any effort and full support rtl direction and ionic team deserve a very big thanks :)
mhartington commentedon Jan 18, 2016
From @adamdbradley on January 1, 2016 1:53
This is the transition animation for ios: https://github.com/driftyco/ionic2/blob/master/ionic/animations/ios-transition.ts
Not sure if this should add logic for RTL, or if there should be a new animation instead. You can however add your own transition, and override the
pageTransitionconfig: https://github.com/driftyco/ionic2/blob/master/ionic/config/modes.ts#L24mhartington commentedon Jan 18, 2016
From @mashaly100200 on January 1, 2016 21:55
hi @adamdbradley , merry christmas
i finished a custom animation class which reverse the default animation class behavior depend on documen.dir
https://gist.github.com/mashaly100200/bf713f2b558285322155
i tested it , and i will test it in real projects soon (inshaa allah)
also i finished some of css classes that was need to be reversed
https://gist.github.com/mashaly100200/dc23529e570034b0dfb9
and if i face more classes need to be reversed , i will add it to this file until i finish one or two real project
also rtl need these configurations in app constructor
https://gist.github.com/mashaly100200/692160b036422d7b018c
i was trying to add all configuration in one place so i found that i can add all things in the app contractor
hope these things can help to make ionic2 fully support rtl
Please feel free to add any corrections or suggestions .
60 remaining items
AmitMY commentedon May 24, 2017
You set your default 'dir' on the HTML tag, and if you want to change it in runtime, you do 'this.platform.setDit('rtl', true)'.
Don't use the dir attribute anywhere else, as nested directions are not supported.
Finally, please use the nightly version, as it is more RTL ready than 3.2.1
If you have any other support questions, please use the ionic forum, and for bugs/features use github
joesleiman commentedon May 24, 2017
@msoni11 no ionic 3.2.0
joesleiman commentedon May 24, 2017
@AmitMY i'm using in all my app in every root tag [att.dir]='isRtl? 'rtl':'ltr'' (in every form : like ion-content)
isn't good ?
Khalid-Nowaf commentedon May 24, 2017
@joesleiman
for now, I use material design page transition only, which is an alternative to avoid page transition from left to right.
joesleiman commentedon May 24, 2017
@AmitMY how can i change the back button icon to right arrow instead of left arrow (when change it to rtl)
AmitMY commentedon May 24, 2017
@joesleiman No, having
dir="rtl"onion-contentis not guaranteeing support. You should always usethis.platform.setDir('rtl', true)and remove all of thedirattributes except the one in thehtmltag. It also controls direction of ionic components from typescript, such as gestures. (note thatsetDirwithtruealso updates the html tag with the correct dir)About the back button, if you use the proper way to set direction, as mentioned above, it will flip your arrows, as done here - #11634. It is only available in the nightly version, and a new version (3.3.0) will be released later today.
I ask again, please, for these kind of support questions use the forum. Github is for bugs/feature requests.
You can read more about RTL here - https://github.com/AmitMY/ionic-site/blob/543cc0dd6d198edd5aa2a9a31ac5bd4702ef5332/content/docs/rtl-support/index.md
This is the official RTL documentation, but it is not yet done so it is not in the website.
joesleiman commentedon May 24, 2017
@AmitMY ok i will do ... thank you so much ,
joesleiman commentedon May 24, 2017
@AmitMY if the user put this.platform.setDir('rtl',true); and close the app and then return to it how can i save for html tag dir='rtl' . so isn't good idea to use it. because it return to dir="ltr"
AmitMY commentedon May 24, 2017
@joesleiman So if your app is multidirectional, and you use the user preferences to decide which side, I would recommend using
NativeStorage, and storing for the key "preferences" the object:{lang: "he", dir: "rtl"}, and then inapp.component.tsonplatform.readycheck if the user has preferences. If he does, apply them bysetDir.No other solution for now.
joesleiman commentedon May 24, 2017
@AmitMY when i use setDir : still the ion-select >> ion-alert : have issue in rtl direction on md (android)
joesleiman commentedon May 24, 2017
@AmitMY i solved it by this :
html[dir="rtl"] .alert-md .alert-radio-icon {
left: 0px;
right: 13px;
}
AmitMY commentedon May 24, 2017
I think you are not using the nightly version as I suggested (
3.2.1-201705231529), and if you are using it, it is a case of overridden style, and it is fixed here #11635joesleiman commentedon May 24, 2017
@AmitMY can you complete the discussion here because i'm finding more and more bugs:
https://forum.ionicframework.com/t/how-can-i-change-the-back-button-in-header-arrow-to-the-right/91591
ionitron-bot commentedon Sep 2, 2018
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.