Problem with number input fields

Hi there!

I’m having a problem with my number input fields. I added an input for “amount” with a minimum value of 0.01. However, I noticed that when the value reaches 32.01, the increment button stops increasing it.

If I manually set the value to 33 and then click the increment button, it works as expected. But if I decrease the value back to 32, the increment button stops working again.

Interestingly, if I remove the min="0.01" restriction, the increment button works correctly at all values.

I hope this is clear. Thank you!

Hi Ihor,

I'm just wondering about the comma in your 32,01

We use comma as a decimal separator here, but in Retool I always have to use the full-stop for decimals.

It wasn't customized
It is as it as
Maybe it's due to locale

Hi everyone!
Has anyone encountered a similar issue before?
I'd be glad to hear how you solved it.
Thank you!

Hi @Ihor_Balabai! I was able to reproduce this interesting bug. I also noticed that different minimum values (0.02, 0.03, 0.04, etc) created different points at which incrementing was blocked. I went ahead and submitted a bug report for this since this not expected behavior.

A workaround could be to create a custom validation rule (ex: {{ self.value <= 0.01 ? "0.01 is the minimum value" : null }}). This would show a red error message if the value is less than 0.01, but it won't actually keep an end user from inputting a lower number. If you are able to enforce the minimum validation elsewhere in your application then that may be enough?

1 Like

Hi. @Mike_M!
And yes, this approach should be acceptable
Thanks for you help!

1 Like