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

Add hover property like in CSS to Button #10261

Open
danies8 opened this issue Sep 22, 2022 · 9 comments
Open

Add hover property like in CSS to Button #10261

danies8 opened this issue Sep 22, 2022 · 9 comments
Labels
Milestone

Comments

@danies8
Copy link

danies8 commented Sep 22, 2022

Description

Add hover property like in CSS to Button

Public API Changes

Add hover property like in CSS to Button

Intended Use-Case

...

@PureWeen
Copy link
Member

Does this cover it?
#10003

@PureWeen PureWeen added the s/needs-info Issue needs more info from the author label Sep 22, 2022
@ghost
Copy link

ghost commented Sep 22, 2022

Hi @danies8. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@nogginbox
Copy link
Contributor

nogginbox commented Sep 23, 2022

I came accross this issue when looking for how to change the hover style for a collectionview item. I think adding PointerOver to visual state manager like this would solve my issue:

<CollectionView.Resources>
    <Style TargetType="Grid">
        <Setter Property="VisualStateManager.VisualStateGroups">
            <VisualStateGroupList>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="Selected" />
                    <VisualState x:Name="PointerOver">
                        <VisualState.Setters>
                            <Setter Property="BackgroundColor" Value="Cyan" />
                        </VisualState.Setters>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateGroupList>
        </Setter>
    </Style>
</CollectionView.Resources>

@danies8 would this solve your problem?

@PureWeen I was wondering, if there a rough release date for this new visual state?

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Sep 23, 2022
@rachelkang rachelkang added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels Sep 23, 2022
@ghost
Copy link

ghost commented Sep 23, 2022

Hi @danies8. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@danies8
Copy link
Author

danies8 commented Sep 24, 2022

I want hover property for button like in CSS.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Sep 24, 2022
@nogginbox
Copy link
Contributor

nogginbox commented Sep 24, 2022

@danies8 if you're using pure XAML, you'd do that sort of styling with a visual state manager.

If you're using CSS as explained in Style apps using Cascading Style Sheets, then it doesn't look like there are supported selectors for things like hover, focus etc.

@PureWeen am I correct about these not being supported?

And @danies8 , do you mean that you'd like to add a hover selector to the CSS supported by MAUI?

So you can do something like this:

.mybutton:hover {
    background-color: red;
}

@danies8
Copy link
Author

danies8 commented Sep 24, 2022

Add hover to the style of the button in xaml.
If it possible add sample code please.

@PureWeen
Copy link
Member

This will all be achievable through the VSM and the PointerOver that we've added. We don't typically add properties for states anymore.

@PureWeen PureWeen removed the s/needs-attention Issue has more information and needs another look label Sep 24, 2022
@PureWeen PureWeen added this to the Backlog milestone Sep 24, 2022
@ghost
Copy link

ghost commented Sep 24, 2022

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.

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Sep 26, 2022
@Eilon Eilon added area-controls-button Button, ImageButton and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants