Skip to content

Commit a178e4f

Browse files
committed
improve raise error within widget docs
1 parent e442431 commit a178e4f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ should change the heading of the (upcoming) version to include a major version b
3030

3131
- Updated docs for ArrayFieldItemTemplate to include prop `onCopyIndexClick`, fixing [#4507](https://github.com/rjsf-team/react-jsonschema-form/issues/4507)
3232
- Use antd 5 in playground
33+
- Updated docs to clarify that errors raised within a widget are not caught during form validation
3334

3435
# 5.24.8
3536

packages/docs/docs/advanced-customization/custom-widgets-fields.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,13 @@ The default widgets you can override are:
9494

9595
## Raising errors from within a custom widget or field
9696

97-
You can raise a custom error by overriding the `onChange` method to raise field/widget errors:
97+
You can raise custom 'live validation' errors by overriding the `onChange` method to provide feedback while users are actively changing the form data. Note that these errors are temporary and are not recognized during the form validation process.
98+
99+
:::warning
100+
101+
This method of raising errors _only_ runs onChange, i.e. when the user is changing data. This will not catch errors `onSubmit`. If you wish to add generic validation logic, you should use the [`customValidate` Form prop](../api-reference/form-props.md#customvalidate).
102+
103+
:::
98104

99105
```tsx
100106
import { ErrorSchema, RJSFSchema, UiSchema, WidgetProps, RegistryWidgetsType } from '@rjsf/utils';

0 commit comments

Comments
 (0)