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

Fix isPressed for ButtonConfiguration #537

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ffried
Copy link

@ffried ffried commented Jul 19, 2023

This should fix #534.

@@ -103,7 +103,7 @@ public struct _Button<Label>: View where Label: View {
public let action: () -> ()

@State
public var isPressed = false
public var isPressed: (down: Bool, inside: Bool) = (false, false)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the public api here. It's a breaking change in theory, but AFAIK _Button should only be used internally.

@ffried
Copy link
Author

ffried commented Jul 24, 2023

@carson-katri I've fixed a small bug in my first implementation (re-entering the button while holding the mouse down didn't work correctly).
Also, the two workflow runs that previously failed don't seem to be related to my changes.

Copy link
Member

@carson-katri carson-katri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@carson-katri carson-katri added the bug Something isn't working label Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

ButtonStyle configuration.isPressed not updated properly
2 participants