Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

RTL doesn't switch the margin #3066

Open
RadwanIbrahim opened this issue Jun 18, 2018 · 5 comments
Open

RTL doesn't switch the margin #3066

RadwanIbrahim opened this issue Jun 18, 2018 · 5 comments
Labels
a/rtl e/2 🕑 2 help wanted We welcome community contributions to any issue, but these might be a good place to start! in-progress This issue has an associated pull request that may resolve it! t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Milestone

Comments

@RadwanIbrahim
Copy link

RadwanIbrahim commented Jun 18, 2018

Description

switch from LTR to RTL doesn't mirror the margin

Steps to Reproduce

  1. add the below XAML to a content page and check the result
    `

     <Label Text="LeftToRight"
            Margin="10" />
     <Grid FlowDirection="LeftToRight">
         <BoxView Margin="50,0,0,0"
                  WidthRequest="100"
                  HeightRequest="100"
                  Color="Red"
                  HorizontalOptions="Start"
                  VerticalOptions="Start"
                  FlowDirection="LeftToRight" />
     </Grid>
     <Label Text="RightToLeft"
            Margin="10" />
     <Grid FlowDirection="RightToLeft">
         <BoxView Margin="50,0,0,0"
                  WidthRequest="100"
                  HeightRequest="100"
                  Color="Red"
                  HorizontalOptions="Start"
                  VerticalOptions="Start"
                  FlowDirection="RightToLeft" />
     </Grid>
    

    `

Expected Behavior

switching from LTR to RTL Should mirror the margin

Actual Behavior

switching from LTR to RTL doesn't mirror the margin

Basic Information

  • Platform Target Frameworks:

    • iOS:
    • Android:
    • UWP:
  • Nuget Packages:
    xamarin forms 3

Screenshots

current state
screenshot_1529295623

desired state
screenshot_1529295404

Reproduction Link

RTLMarginIssue.zip

@AmrAlSayed0
Copy link

AmrAlSayed0 commented Jun 27, 2018

Friendly nudge here, is there any plan for this issue? I looked at #1222 but there was no mention of Padding and Margin.

Also, why is this issue labeled Enhancement rather than Bug? I mean it seems acceptable that if the flow direction was to reverse the padding and margin should too. I can't think of a case where you wouldn't want that behavior. Of course, I could be wrong.

@danielkatz
Copy link

danielkatz commented Jul 10, 2018

@radekdoulik The issue is actually worse because Padding does respect the element's FlowDirection, while Margin does not.

Given this, IMO @AmrAlSayed0 is right, and this should qualify as a bug, and the title of the issue should be corrected.

To workaround this issue on our project i've come up with RtlThickness.
The project also includes a demo of the issue and the solution with a comparison between Margin and Padding.

@RadwanIbrahim RadwanIbrahim changed the title RTL does't switch the margin and the padding RTL does't switch the margin Jul 30, 2018
@RadwanIbrahim
Copy link
Author

@samhouts we appreciate if you could mark this as bug not enhancements as we cant use RTL Without doing workaround to fix this

@samhouts samhouts added the inactive Issue is older than 6 months and needs to be retested label Jan 28, 2019
@samhouts samhouts added help-wanted up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! help wanted We welcome community contributions to any issue, but these might be a good place to start! and removed help-wanted labels Jun 28, 2019
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Jul 30, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts
Copy link
Member

This issue doesn't seem to have had any activity in a long time. We're working on prioritizing issues and resolving them as quickly as we can. To help us get through the list, we would appreciate an update from you to let us know if this is still affecting you on the latest version of Xamarin.Forms, since it's possible that we may have resolved this as part of another related or duplicate issue. If we don't see any new activity on this issue in the next 30 days, we'll evaluate whether this issue should be closed. Thank you!

@samhouts samhouts added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Sep 18, 2020
@AmrAlSayed0
Copy link

AmrAlSayed0 commented Sep 19, 2020

@samhouts I have already submitted a PR #11469 to fix this issue and it is targeted on 5.0.0 branch. Up until I fixed it, the issue was still there.

@samhouts samhouts removed inactive Issue is older than 6 months and needs to be retested s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. labels Sep 30, 2020
@hartez hartez changed the title RTL does't switch the margin RTL doesn't switch the margin Oct 7, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@PureWeen PureWeen added this to the 5.0.1 milestone Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/rtl e/2 🕑 2 help wanted We welcome community contributions to any issue, but these might be a good place to start! in-progress This issue has an associated pull request that may resolve it! t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants