Mantine shows the errors its widgets leave out through FieldErrorTemplate
Detect
- Under
@rjsf/mantine, errors of a custom widget orui:field, of@rjsf/core'sRatingWidget, or of a widget whoseinputWrapperOrderleaves out'error', now show beneath the field on the rendered page and in snapshots. - A custom
ui:fieldin your code that renders one of this theme's widgets withrawErrorsbut withoutpresentation, 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:
- A custom field draws its own label and description, and the plan wins over hideLabel
- A widget registered under a built-in key such as RadioWidget or RatingWidget takes that key's presentation declaration
- Mantine inputs reference rjsf's error, description and help ids
- A Mantine widget or template of your own draws errors as its registry key declares