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

Transaction doesn't work for GestureStateGesture #543

Open
shial4 opened this issue Aug 19, 2023 · 1 comment
Open

Transaction doesn't work for GestureStateGesture #543

shial4 opened this issue Aug 19, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@shial4
Copy link

shial4 commented Aug 19, 2023

Describe the bug
Transaction inside gestures .onChange, doesn't work, below code should animate rectangle fill color between the states.

To Reproduce
Steps to reproduce the behavior:

Rectangle()
                    .fill(self.isDetectingLongPress ? Color.pink : (self.completedLongPress ? Color.purple : Color.gray))
                    .frame(width: 100, height: 100)
                    .gesture(LongPressGesture(minimumDuration: 2)
                        .updating($isDetectingLongPress) { currentState, gestureState, transaction in
                            gestureState = currentState
                            transaction.animation = Animation.easeIn(duration: 2.0)
                        }
                        .onEnded { finished in
                            self.completedLongPress = finished
                        })

Expected behavior
Rectangle should be animated.

@shial4 shial4 added the bug Something isn't working label Aug 19, 2023
@shial4
Copy link
Author

shial4 commented Aug 19, 2023

#538 (comment)

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

No branches or pull requests

2 participants