Closed karthikgs7 closed 4 years ago
Hey @karthikgs7, thanks for the report!
We've actually stumbled upon this before, and we've gotten some confirmation from Apple that this is most likely a SwiftUI bug. We documented this on the WithViewStore
type:
To work around can you use the version of Stepper
that takes a binding instead? You will need to manually check the before and after value in the reducer to determine if the value was incremented or decremented.
Gonna close this issue for now, but please feel free to reopen if you have more questions!
Describe the bug After couple of actions, one of the buttons got disabled, and tapping on the other button sends the invalid action to the store.
To Reproduce Try copy-pasting the code in SwiftUI file, run and do couple of actions with the stepper.
Expected behavior Tapping on the button should be changing the value without disabling the UI elements.
Screenshots
Environment