Skip to content

Date Events

PropertyTypeDescription
onTypefunction(optional) Will be called on every input and date picker interaction. Returns an object. See Returned Object below.
onSubmitfunction(optional) Will be called once a user presses the submit button.
onCancelfunction(optional) Will be called once a user presses the cancel button.
onResetfunction(optional) Will be called once a user presses the reset button.
onShowfunction(optional) Will be called once date-picker is visible.
onHidefunction(optional) Will be called once date-picker is hidden.
onDaysRenderfunction(optional) Will be called right before every new calendar view gets rendered. See the example above.

Events

PropertyTypeDescription
onChange(value) => void(optional) Will be called on value changes made by the user, with the new value as argument. When an async function is used, the corresponding FieldBlock will show an indicator on the field label. You can return { success: 'saved' } as const to show a success symbol, or an error or an object with these keys { info: 'Info message', warning: 'Warning message', error: Error('My error') } as const. The second parameter is an object that e.g. contains props (all given Field.* properties).
onFocus(value) => void(optional) Will be called when the component gets into focus. Like clicking inside a text input or opening a dropdown. Called with active value as argument. The second parameter is an object that e.g. contains props (all given Field.* properties).
onBlur(value) => void(optional) Will be called when the component stop being in focus. Like when going to next field, or closing a dropdown. Called with active value as argument. The second parameter is an object that e.g. contains props (all given Field.* properties).