Stepper Bug?

I am trying to implement Stepper with SwiftUI and have added maxLimit to 5 but it expands that limit with State.

Code Block            
Stepper("Show \(String(repeating: "$", count: maxPriceLevel)) or below") {
          if maxPriceLevel < 5 {
              maxPriceLevel += 1
            }
          } onDecrement: {
            if maxPriceLevel > 1 {
              maxPriceLevel -= 1
            }
          }


So, The problem here is if I click continuously on increment, let say 8 times, even though maxPricelevel is of 5, I have to click 3 times first to actual decerement to be done.

You can use the in: and step: parameters for Stepper to control the range and increment amounts.
Code Block Swift
Stepper("Show \(String(repeating: "$", count: maxPriceLevel)) or below", value: $maxPriceLevel, in: 1...5, step: 1)

@BabyJ It works but still I want to know why it not decrement or increment using maxPriceLevel as its state variable and its value always in between 1 to 5 with my code as well then why it behaves like that and have to click multiple times to increment or decrement?
Stepper Bug?
 
 
Q