Skip to content

Radiobutton doesn't appear correctly when FlowDirection is RightToLeft #6708

Closed

Description

@hamiddd1980

Description

When FlowDirection is RightToLeft in Page, the RadioButton Content doesn't appear correctly.
For RightToLeft languages, the Content must be at the Right side , but currently the content goes to Left end(see below)

Steps to Reproduce

1-Create a New MAUI Project
2-Android Manifest :android:supportsRtl="true"
3-Add new Page
4-Code:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             FlowDirection="RightToLeft"
             x:Class="MauiApp29.Page1"
             IconImageSource="edit.png"
             Title="page1"
             BackgroundColor="GreenYellow"
             Padding="8">
    <ContentPage.Content>
        <VerticalStackLayout>
            <Label Text="What's your favorite animal?" />
            <RadioButton Content="Cat"/>
            <RadioButton Content="Dog" />
            <RadioButton Content="Elephant" />
            <RadioButton Content="Monkey"
                 IsChecked="true" />
        </VerticalStackLayout>
    </ContentPage.Content>
</ContentPage>

Screenshot_1651337756

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 8

Did you find any workaround?

No response

Relevant log output

No response

Activity

  1. added
    s/needs-verification
    t/bug
    on Apr 30, 2022
  2. added
    legacy-area-controls
    area-controls-radiobutton
    and removed
    s/needs-verification
    on May 2, 2022
  3. added this to the 6.0.300-servicing milestone on May 2, 2022
  4. added
    s/verified
    on May 5, 2022
  5. kristinx0211 commented on May 5, 2022

    @kristinx0211

    can be reproduced on android 11.

  6. modified the milestones: 6.0-servicing, Backlog on Aug 30, 2022
  7. hartez commented on Feb 2, 2023

    @hartez
    Contributor

    Well, this one's a stumper. So, the behavior in the example is expected, because the text itself is LTR. However, if the text is changed to RTL (if "Cat" is replaced with "חתול"), then the alignment should be correct, something like this:
    image

    That's how it works on native Android. And it seems like it should be working that way based on the properties that MAUI is setting for the RadioButton. But for some reason, the settings aren't taking.

    So somewhere in the stack we must be overwriting the desired native settings for TextAlignment or TextDirection (or something else that I'm missing).

  8. added
    fixed-in-8.0.0-preview.3.8149
    on Apr 12, 2023
  9. ghost locked as resolved and limited conversation to collaborators on May 12, 2023
  10. modified the milestones: Backlog, .NET 8 on May 24, 2023
  11. removed
    legacy-area-controls
    on May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-controls-radiobuttonfixed-in-8.0.0-preview.3.8149platform/androids/verifiedt/bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions