NumberInput Erratic Behavior (with no workaround > can't post my form)

My form has a NumberInput, with a default value set to 3. Value must be between 1 and 28.
While I use the app and try to change this input value, value is always set back to 0 when I click outside this input box.
I can't validate and post the form.
On your online doc, the component doesn't act this strange.
I use online Retool.
Can you help please ?


  1. Default Value in Component Settings:
    Make sure you have set the defaultValue property correctly in your Retool editor.
  1. Validation Logic:
    Ensure you have the validation logic set correctly to keep the value between 1 and 28. You can do this in the Validation tab by adding a condition like:
value >= 1 && value <= 28

OR use minimum / maximum option in validation rules.
3. JavaScript Logic:
Double-check any JavaScript code that might be running on the form. It might be resetting the value to 0 unexpectedly.
4. Event Handling:
Ensure there are no event handlers (e.g., onBlur, onChange) that incorrectly reset the value.
5. Custom Scripts:
Look for any custom scripts that may override or reset your NumberInput.

Also sometimes just replacing the component with a new one might help if something is bugged with it.

1 Like