Given a min value > 0 and a blank in the form field, the field will be reset to the min value if the field loses focus.
I encountered this issue in version 5.0.9, which is why I had to fork it internally. Now as I was preparing my fix to to submit to upstream, I saw someone else reported this issue as #2829 which you fixed in 7405873. 👍
Unfortunately, your approach to take "" into the condition solves the issue only partly: " " still triggers the behaviour. The root of the issue is using the <-operator with strings, therefore I recommend using parseFloat(...) before comparing the value with opt.min.
Here is a jsfiddle: https://jsfiddle.net/rcpxyg1t/6/
- OS: macOS 15, iOS 18
- Browser: Safari and Firefox on macOS, Safari on iOS
- Inputmask version: 5.0.10
Given a min value > 0 and a blank in the form field, the field will be reset to the min value if the field loses focus.
I encountered this issue in version 5.0.9, which is why I had to fork it internally. Now as I was preparing my fix to to submit to upstream, I saw someone else reported this issue as #2829 which you fixed in 7405873. 👍
Unfortunately, your approach to take
""into the condition solves the issue only partly:" "still triggers the behaviour. The root of the issue is using the<-operator with strings, therefore I recommend usingparseFloat(...)before comparing the value withopt.min.Here is a jsfiddle: https://jsfiddle.net/rcpxyg1t/6/