A Mantine widget or template of your own draws errors as its registry key declares
Detect
- In your code,
widgets={{ ... }}on a MantineFormorwithTheme()call, or a component passed toui:widget. BaseInputTemplate,FieldErrorTemplateorObjectFieldTemplatein thetemplatesgiven to a MantineForm.- In your
uiSchema, aninputWrapperOrderthat leaves out'error'. - On the rendered page, a custom widget's errors are missing or shown twice.
Change
FieldErrorTemplate used to render a hidden copy of every field's errors. It now shows only the errors no widget shows (#5490), so who draws an error depends on the plan:
- A widget of your own takes the declaration of the key it is registered under. Under one of the theme's widget keys, such as
TextWidget, it is declared to draw its own errors, so it should renderpresentation.errors.messages, or its errors aren't shown. Under any other key, or given directly asui:widget, its errors are shown byFieldErrorTemplate. - One registered as
RangeWidget,AltDateWidgetorAltDateTimeWidgetis also declaredlabelledBy: 'aria-labelledby', so a label the template draws for it has nofor. It is named only through thearia-labelledbyit spreads fromgetControlAttributes(). - A
BaseInputTemplateof your own draws the errors of@rjsf/core'sTextWidget,EmailWidget,URLWidgetandUpDownWidget, which the theme declareserrors: 'self'because its ownBaseInputTemplatedraws them. It should renderpresentation.errors.messagesas well, or they aren't shown. - A custom
ObjectFieldTemplaterenders the object's own errors only if it readspresentation.errors.messagesitself. - A widget whose
inputWrapperOrderleaves out'error'shows its errors throughFieldErrorTemplateinstead. A customFieldErrorTemplaterenders only errors Mantine's own element doesn't, and can give its element the field'serrorId(id), as@rjsf/core's does.
A component given to ui:widget that no key registers follows the theme's default plan; see A widget component given to ui:widget without a registry key gets the theme's default label plan.
Verify
Trigger a validation error on each field your custom widget or template draws: the error shows once, and the input is described by it.
Also read: