diff --git a/docs/fundamentals/systems/form/interaction-states.md b/docs/fundamentals/systems/form/interaction-states.md index 2e675475d..706d7e86f 100644 --- a/docs/fundamentals/systems/form/interaction-states.md +++ b/docs/fundamentals/systems/form/interaction-states.md @@ -175,3 +175,9 @@ export const feedbackVisibility = () => html` > `; ``` + +## Resetting + +In some situations, resetting the interaction state might be desired, e.g., to clear an entire form or a single input field from errors. + +In those cases, using the `resetInteractionState` on a field or a form resets its respective interaction state without resetting the modelValue. diff --git a/docs/fundamentals/systems/form/model-value.md b/docs/fundamentals/systems/form/model-value.md index 33d0353a0..223d56fba 100644 --- a/docs/fundamentals/systems/form/model-value.md +++ b/docs/fundamentals/systems/form/model-value.md @@ -33,3 +33,12 @@ For more information about parsing and the Unparseable type, see [Formatting and element' (for instance a lion-input) to a top element (for instance lion-form). An example path could be [lionForm, lionFieldset, lionInput] - `initialize`: whether this is the first time the event is fired (on first render of the FormControl) + +### Resetting + +Resetting a form can be done by two different methods. + +- `resetGroup()`: resets every form field to its initial/prefilled value and interaction state +- `clearGroup()`: clears every form field, disregarding its initial/prefilled value and interaction state + +Both methods do so by calling `reset|resetGroup` or `clear|clearGroup` on each `LionField` found in the form.