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

[Bug] iOS 14: Radio buttons gained unremovable one pixel border #12345

Closed
Tommigun1980 opened this issue Oct 2, 2020 · 10 comments · Fixed by #12742
Closed

[Bug] iOS 14: Radio buttons gained unremovable one pixel border #12345

Tommigun1980 opened this issue Oct 2, 2020 · 10 comments · Fixed by #12742
Assignees
Labels
a/radiobutton 🔘 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. iOS 14 t/bug 🐛
Milestone

Comments

@Tommigun1980
Copy link

Description

When updating to iOS 14, all my radio buttons now show an unremovable one pixel border around them.

Steps to Reproduce

  1. Add a radio button and run on iOS 14.

I used the following:

                    <RadioButton
                        Content="Hello world!"
                        IsChecked="True"
                        GroupName="myRadioGroup" />

Please note that even explicitly trying to remove the border doesn't work:

                    <RadioButton
                        Content="Hello world!"
                        IsChecked="True"
                        BorderColor="Transparent"
                        BorderWidth="0"
                        GroupName="myRadioGroup" />

Expected Behavior

There should not be a border around the radio buttons.

Actual Behavior

There is a border around the radio buttons.

Basic Information

  • Version with issue: Xamarin.Forms 5-pre1
  • IDE: VS For Mac 2019
  • Affected Devices: iOS 14 devices

Screenshots

Screenshot 2020-10-02 at 21 07 50

Workaround

Tried to explicitly set border width to 0 and border color to transparent, but the border is still shown and can't seemingly be hidden.

@Tommigun1980 Tommigun1980 added s/unverified New report that has yet to be verified t/bug 🐛 labels Oct 2, 2020
@samhouts samhouts added this to New in Triage Oct 3, 2020
@jsuarezruiz
Copy link
Contributor

I have created a reproduction sample:
Issue12345.zip

But cannot reproduce the issue:
Captura de pantalla 2020-10-05 a las 10 55 10

I am using Xamarin.Forms 5-pre1 and testing in iOS 14 simulators, can see the result in the previous screenshot. @Tommigun1980 Could you review the attached sample?.

@jsuarezruiz jsuarezruiz moved this from New to Needs Info in Triage Oct 5, 2020
@jsuarezruiz jsuarezruiz added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Oct 5, 2020
@Tommigun1980
Copy link
Author

I have created a reproduction sample:
Issue12345.zip

But cannot reproduce the issue:
Captura de pantalla 2020-10-05 a las 10 55 10

I am using Xamarin.Forms 5-pre1 and testing in iOS 14 simulators, can see the result in the previous screenshot. @Tommigun1980 Could you review the attached sample?.

Hi @jsuarezruiz - did you test your repro project with Xamarin.Forms 5? It only happens if I use iOS 14 + XF5. There is no problem with XF4, to which I have temporarily downgraded now.

Thanks.

@Redth Redth removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Oct 16, 2020
@Tommigun1980
Copy link
Author

Hi again @jsuarezruiz - I decided to update to Xamarin.Forms 5 again now that dependent libraries work properly with it so this became an issue again. Could you please confirm if you did your test with Xamarin.Forms 5 as the issue doesn't happen with Xamarin.Forms 4.

I double checked the styling in my app and I don't have any custom renderers or styles set up for the radio buttons, so it should be vanilla on my side.

My guess is that the radio button incorrectly uses some other component's color as its border color in XF 5. The color I get in the border is the exact same color I use as an 'accent color' in my app's theme. Problem is I style almost every single control with it so it would take me a long time to isolate which one the radio button is incorrectly using. Maybe you guys could give a pointer on this and I would be happy to help as radio buttons look very buggy for me now.

Thank you.

@Redth Redth moved this from Needs Info to New in Triage Oct 20, 2020
@jsuarezruiz
Copy link
Contributor

@Tommigun1980 I am using Xamarin.Forms 5.0.0 branch and iOS 14.1 simulators. Could you attach an example where reproduce the issue?

@Tommigun1980
Copy link
Author

Tommigun1980 commented Oct 28, 2020

@Tommigun1980 I am using Xamarin.Forms 5.0.0 branch and iOS 14.1 simulators. Could you attach an example where reproduce the issue?

Hi. This is the XAML:

                <StackLayout Style="{StaticResource ContentStyle}">
                    <Label Text="Select date and time" />
                    <RadioButton
                        Content="Right now"
                        IsChecked="True"
                        GroupName="timeRadioGroup" />
                    <RadioButton
                        Margin="0, -10, 0, 0"
                        x:Name="specifyDateAndTimeRadioButton"
                        Content="Specify date and time"
                        GroupName="timeRadioGroup" />
                    <toolkit:Expander
                        IsVisible="{Binding IsChecked, Source={x:Reference specifyDateAndTimeRadioButton}}"
                        IsExpanded="{Binding IsChecked, Source={x:Reference specifyDateAndTimeRadioButton}}">
                        <StackLayout>
                            <DatePicker />
                            <TimePicker />
                        </StackLayout>
                    </toolkit:Expander>
                </StackLayout>

I don't have any special renderers or styles for check box.

@PureWeen
Copy link
Contributor

PureWeen commented Oct 29, 2020

Not sure @Tommigun1980

did you test with @jsuarezruiz 's repro? I updated his repro to the latest 5.0 and I don't see any borders

Pinging @hartez just in case something rings a bell for him

That red border looks like a selector. Do you have anything enabled that would just select elements in the view? like a layout inspector or other?

@PureWeen PureWeen moved this from New to Needs Info in Triage Oct 29, 2020
@PureWeen PureWeen added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Oct 29, 2020
@Tommigun1980
Copy link
Author

Tommigun1980 commented Oct 29, 2020

Hi @PureWeen and @jsuarezruiz, I was not able to reproduce it with the repro case when run as is, but was when copied to my project. I removed one implicit style at a time until found that the following affected the radio buttons:

<Style
    TargetType="Frame">
    <Setter
        Property="BorderColor"
        Value="{DynamicResource MyOutlineColor}" />
</Style>

So apparently a frame's stylings "bleed" into radio buttons.
What I don't understand is why this happens only on iOS 14.

@Tommigun1980
Copy link
Author

Tommigun1980 commented Oct 29, 2020

I can't get this to work as is. I need the implicit styling on the frame, but not on radio buttons.
Explicitly overriding BorderColor on the radio button instances, or by adding

<Style
    TargetType="RadioButton"
    ApplyToDerivedTypes="True">
    <Setter
        Property="BorderColor"
        Value="{x:Null}" />
</Style>

does nothing -- if you ever set a border color on frames then radio buttons look ugly on iOS 14.
Maybe I updated XF around the same time and it was a change in XF instead, but this definitely did use to work. I no longer have any iOS 13 devices to test on.

As a workaround I now do

<!-- TODO: set value to Value="{DynamicResource MyOutlineColor}" once https://github.com/xamarin/Xamarin.Forms/issues/12345 is fixed />-->
<Style
    TargetType="Frame">
    <Setter
        Property="BorderColor"
        Value="{x:Null}" />
</Style>

and manually set frame border colors. Seems to do the trick, so this is no longer urgent for me, but may bite other people who have set a frame border color.

Thank you.

@PureWeen PureWeen removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/unverified New report that has yet to be verified labels Oct 29, 2020
@PureWeen PureWeen moved this from Needs Info to Ready For Work in Triage Oct 29, 2020
@PureWeen PureWeen added this to the 5.0.0 milestone Oct 29, 2020
@PureWeen PureWeen added this to To do in vNext+1 (5.0.0) via automation Oct 29, 2020
@PureWeen PureWeen moved this from To do to Blockers in vNext+1 (5.0.0) Oct 29, 2020
@Redth Redth moved this from Ready For Work to Needs Estimate in Triage Oct 29, 2020
@PureWeen PureWeen added the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Oct 29, 2020
@samhouts samhouts moved this from Blockers to To do 2 in vNext+1 (5.0.0) Nov 3, 2020
@samhouts samhouts moved this from To do 2 to Blockers in vNext+1 (5.0.0) Nov 3, 2020
@hartez hartez removed this from Needs Estimate in Triage Nov 5, 2020
@hartez hartez moved this from Blockers to In Review in vNext+1 (5.0.0) Nov 5, 2020
@rmarinho rmarinho moved this from In Review to In Progress in vNext+1 (5.0.0) Nov 5, 2020
vNext+1 (5.0.0) automation moved this from In Progress to Done Nov 11, 2020
rmarinho pushed a commit that referenced this issue Nov 11, 2020
#12742) fixes #12345

* Bind RadioButton default template root properties to RadioButton's properties
Fixes #12345

* Revert project file changes
@programatix
Copy link

I'm still having this issue with Xamarin Forms 5.0.0.2401 even though it is marked as resolved. Radio buttons inside a Frame with targeted BorderColor style cause them to have border.

@ahoke-cr
Copy link

ahoke-cr commented Jun 3, 2022

I have radiobuttons not inside a frame that have a black 1-pixel border on iOS. I have a global style setting border width to zero and color to transparent. iOS 15.5 and Xamarin.Forms 5.0.0.2083

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/radiobutton 🔘 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. iOS 14 t/bug 🐛
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

7 participants