8000 Transaction doesn't work for GestureStateGesture · Issue #543 · TokamakUI/Tokamak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Transaction doesn't work for GestureStateGesture #543
Open
@shial4

Description

@shial4

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0