I cannot clear the number input. Once I clear the number input, if I refresh the page, the default value overrides the null one.
Hi @avwchapman ,
We use AJV to set the default values. As null
is not a valid number, it is overridden with the default value. If you mean that you remove the number in the renderer, it is reset to undefined
. It is the expected behavior that undefined
is changed to the default value by AJV on load.
To allow null
values for a number, you probably need to adapt the property’s type in the JSON Schema to something like: "type": ["string", "null"]
.
Doing that, you’ll need to re-register the renderer and possibly adapt it to handle null
values.
An easier solution might be to remove the default value from your schema and inititialize the data object with this yourself.