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

Mantine shows the errors its widgets leave out through FieldErrorTemplate

Detect​

  • Under @rjsf/mantine, errors of a custom widget or ui:field, of @rjsf/core's RatingWidget, or of a widget whose inputWrapperOrder leaves out 'error', now show beneath the field on the rendered page and in snapshots.
  • A custom ui:field in your code that renders one of this theme's widgets with rawErrors but without presentation, whose errors now show twice.

Change​

Errors the theme's widgets don't show are shown by FieldErrorTemplate, where they were announced from a hidden copy and never shown. The markup and ids behind this are in Mantine inputs reference rjsf's error, description and help ids, and how a Mantine widget or template of your own draws errors in A Mantine widget or template of your own draws errors as its registry key declares.

A custom ui:field that hands one of this theme's widgets rawErrors but not its plan, as FieldProps.presentation advises for a field that doesn't declare WIDGET_FIELD_PRESENTATION, shows the field's errors twice: the widget, given no plan, draws them, and so does the template. Pass the widget hideError or no rawErrors:

- <TextWidget {...widgetProps} rawErrors={rawErrors} />
+ <TextWidget {...widgetProps} />

Or declare WIDGET_FIELD_PRESENTATION for the field and hand the widget its presentation, as A custom field draws its own label and description describes:

<Form fields={{ MyField }} presentation={{ fields: { MyField: WIDGET_FIELD_PRESENTATION } }} />

A widget of your own registered as RatingWidget takes the theme's declaration for that key; see A widget registered under a built-in key takes that key's presentation declaration.

Verify​

Each field's errors show once, beneath it, a rating field's and a custom widget's included.

Also read: