Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisualStates for RadioButton not working #12805

Closed
cgp1976 opened this issue Jan 20, 2023 · 5 comments
Closed

VisualStates for RadioButton not working #12805

cgp1976 opened this issue Jan 20, 2023 · 5 comments
Labels
area-controls-radiobutton RadioButton, RadioButtonGroup area-xaml XAML, CSS, Triggers, Behaviors platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@cgp1976
Copy link

cgp1976 commented Jan 20, 2023

Description

After the recent updates, I noticed that the VisualStates is not working as intended anymore for radio button. basically the radio button text color is not reflecting accordingly based on visualstates

Steps to Reproduce

Create a new .net maui project

replace the mainpage.xaml contentpage body with the following

    <ContentPage.Resources>
        <Style TargetType="RadioButton">
            <Setter Property="VisualStateManager.VisualStateGroups">
                <VisualStateGroupList>
                    <VisualStateGroup x:Name="CheckedStates">
                        <VisualState x:Name="Checked">
                            <VisualState.Setters>
                                <Setter Property="TextColor"
                                        Value="Green" />
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="Unchecked">
                            <VisualState.Setters>
                                <Setter Property="TextColor"
                                        Value="Red" />
                            </VisualState.Setters>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateGroupList>
            </Setter>
        </Style>
    </ContentPage.Resources>
    <StackLayout>
        <Label Text="What's your favorite mode of transport?" />
        <RadioButton Content="Car" />
        <RadioButton Content="Bike" />
        <RadioButton Content="Train" />
        <RadioButton Content="Walking" />
    </StackLayout>

Link to public reproduction project repository

nil

Version with bug

Unknown/Other (please specify)

Last version that worked well

7.0 (current)

Affected platforms

macOS

Affected platform versions

nil

Did you find any workaround?

No response

Relevant log output

my dotnet workload list

maui-maccatalyst           7.0.58/7.0.100         SDK 7.0.200-preview.22628
ios                        16.1.1481/7.0.100      SDK 7.0.200-preview.22628
android                    33.0.26/7.0.100        SDK 7.0.200-preview.22628
@cgp1976 cgp1976 added the t/bug Something isn't working label Jan 20, 2023
@jsuarezruiz jsuarezruiz added area-xaml XAML, CSS, Triggers, Behaviors platform/macOS 🍏 macOS / Mac Catalyst area-controls-radiobutton RadioButton, RadioButtonGroup labels Jan 20, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jan 23, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jan 23, 2023
@ghost
Copy link

ghost commented Jan 23, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@mattleibow
Copy link
Member

I see Windows also has an issue in 7.0.59 where the text color does not change - except when you hover over it - then it goes green until the cursor leaves it.

@mattleibow mattleibow changed the title MACOS VisualStates for radiobutton not working as intended? VisualStates for RadioButton not working Mar 8, 2023
@mattleibow
Copy link
Member

Tested on iOS, TextColor does nothing - even when explicitly set on the element.

@mattleibow
Copy link
Member

Not certain, but this PR may fix the color issues #13215

@dustin-wojciechowski
Copy link
Contributor

@mattleibow This may have been fixed recently, this is what I get with the repro when I checkout main:
image

And on MacOS:
image

@ghost ghost locked as resolved and limited conversation to collaborators Apr 14, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-radiobutton RadioButton, RadioButtonGroup area-xaml XAML, CSS, Triggers, Behaviors platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants