Skip to main content
Version: Current (v7.0.0-beta.3)

A numeric field pattern can block a submit before RJSF validates it

Detect​

  • In your data: legacy or server values that aren't numbers loaded into a number/integer field.
  • On the rendered page: submitting shows the browser's own "Please match the requested format" message on the field, and neither onSubmit nor onError runs.

Change​

The numeric field is now a text input with a pattern (see Number and integer fields render a text input), so native constraint validation blocks a submit whose value doesn't match, and the browser shows its message instead of an RJSF error. To make RJSF's validation the only validator, set noHtml5Validate:

-<Form schema={schema} validator={validator} />
+<Form schema={schema} validator={validator} noHtml5Validate />

Verify​

  • Submitting the bad value calls onError and shows RJSF's type error on the field.

Also read: