onCommit | function | (optional) Will be called on a nested form context commit – if validation has passed. The first parameter is the committed data object. The second parameter is an object containing a method to clear the internal data { clearData }. |
onChange | function | (optional) Will be called when a value of a field was changed by the user, with the data set (including the changed value) as argument. When an async function is provided, it will show an indicator on the current label during a field change. Related props: minimumAsyncBehaviorTime and asyncSubmitTimeout. You can return an error or an object with these keys { info: 'Info message', warning: 'Warning message', error: Error('My error') } as const in addition to { success: 'saved' } indicate the field was saved. Will emit unvalidated by default and validated when an async function is provided (like onSubmit). The second parameter is an object containing the filterData, resetForm and clearData functions. |
onPathChange | function | (optional) Will be called when a value of a field was changed by the user, with the path (JSON Pointer) and new value as arguments. Can be an async function. Will emit unvalidated by default and validated when onChange is an async function. |
onClear | function | (optional) Will be called when the form is cleared via Form.clearData or via the onSubmit event (or onCommit) argument { clearData }. |