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

[regression/8.0.0-preview.7.8842] VisualState does not return to Normal state when using an AppThemeBinding #17354

Closed
daltzctr opened this issue Sep 13, 2023 · 4 comments · Fixed by #17215
Assignees
Labels
area-xaml XAML, CSS, Triggers, Behaviors fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373! i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@daltzctr
Copy link
Contributor

daltzctr commented Sep 13, 2023

Description

Utilizing a VisualState that defines an AppThemeBinding in PointerOver never returns to Normal state.

Steps to Reproduce

Given

            <Grid WidthRequest="500" ColumnDefinitions="*">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroupList>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="PointerOver">
                                <VisualState.Setters>
                                    <Setter Property="BackgroundColor" Value="{AppThemeBinding Dark=Red, Light=White}"/>
                                </VisualState.Setters>
                            </VisualState>
                            <VisualState x:Name="Normal">
                                <VisualState.Setters>
                                    <Setter Property="BackgroundColor" Value="Transparent" />
                                </VisualState.Setters>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateGroupList>
                </VisualStateManager.VisualStateGroups>
                <Label Text="I'm a grid. Hover over me to change background color"/>
            </Grid>

Observe the following.

  1. Hover over the grid. Observe the color change to RED.
  2. No longer hover over the grid. The color still stays RED.

This does not occur if you remove the AppThemeBinding binding and just use RED.

Link to public reproduction project repository

https://github.com/daltzctr/maui-hoverstate-repro

Version with bug

8.0.0-preview.7.8842

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-preview.6.8686

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

Don't use AppThemeBinding. Unfortunately, for applications that support more than one theme (dark and white), this is not an acceptable solution.

Relevant log output

No response

@daltzctr daltzctr added the t/bug Something isn't working label Sep 13, 2023
@samhouts samhouts added area-xaml XAML, CSS, Triggers, Behaviors potential-regression This issue described a possible regression on a currently supported version., verification pending labels Sep 13, 2023
@samhouts samhouts added this to the .NET 8 GA milestone Sep 13, 2023
@samhouts
Copy link
Member

very similar to #16960, but that first appeared in preview2

@samhouts
Copy link
Member

Confirmed that this regressed between 8.0.0-preview.6.8686 and 8.0.0-preview.7.8842. #13818 seems sus.

@samhouts samhouts changed the title [regression/8.0.0-rc.1.9171] VisualState does not return to Normal state when using an AppThemeBinding [regression/8.0.0-preview.7.8842] VisualState does not return to Normal state when using an AppThemeBinding Sep 14, 2023
@samhouts samhouts added i/regression This issue described a confirmed regression on a currently supported version and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Sep 14, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Sep 14, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Windows 11(8.0.0-preview.7.8842) with below Project:
maui-hoverstate-repro.zip

image

@StephaneDelcroix
Copy link
Contributor

similar, but different, to #16538. Fixed by the same changes

@samhouts samhouts added the fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373! label Oct 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-xaml XAML, CSS, Triggers, Behaviors fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373! i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants