- Fixed a TypeScript issue by preventing the
FormValidityObserver'sdefaultErrorsoption from having the ability to influence the genericMorRtype parameters.
- Added a more-ergonomic Custom Vue Directive,
v-auto-observe, to handle automatic observing/unobserving for theFormValidityObserver.
- Fixed a TypeScript issue for the
autoObservefunctionref.
- Enable
radiogroups to properly partake in field revalidation.
- Field revalidation is now supported with the
FormValidityObservervia therevalidateOnoption. - You can now pass
nullto thetypeargument of theFormValidityObserverto use it in "Manual Mode".
Please see the documentation for more details on how to use these new features.
- Arrays are no longer supported for the
FormValidityObserver'stypeconstructor argument. - The
useFormValidityObserverReact hook has been removed because it isn't genuinely useful. The new recommendation is to replace all calls touseFormValidityObserverwith memoized calls tocreateFormValidityObserver. (React only)
If you'd like to understand why these breaking changes were made, please see the Design Decisions document.
- Support rendering error messages to the DOM by default. (This opens the door for using JS framework state to render error messages to the DOM. It also opens the door for safely using a framework's
renderfunction to render error messages to the DOM. See this PR for additional details.)
- Fixed a bug in
@form-observer/react'suseFormValidityObserverfunction where updates to thedefaultErrorsoption would not cause the hook to update its memoized value.
- Enable developers to configure the default error messages to display for the validation constraints. (This will help remove redundancy from codebases.)
- Enable developers to use a default custom validation function for all of their form fields.
(Note: Version 0.7.1 is buggy for Lit and Preact and should not be used. Use 0.7.2 instead.)
- Enable developers to configure the default error messages to display for the validation constraints. (This will help remove redundancy from codebases.)
- Enable developers to use a default custom validation function for all of their form fields.
- Corrected the default
rendererfunction for@form-observer/solidto take into account the coreFormValidityObserver's new error-clearing behavior inv0.7.0.
- The
clearFieldErrormethod has been refactored to call theFormValidityObserver'srendererfunction withnull. This change will allow the coreFormValidityObserverto leverage a given JS Framework'srenderfunction more seamlessly.
- There is now a
Preactintegration for the Form Observer tools via the@form-observer/preactNPM package.
- Correct documentation in package README
FormObserver.unobserve()will now remove event listeners from the correct Root Node even if the method is called after a given<form>is moved to a different root.
- Memory leaks will no longer occur when an
autoObserved form is repeatedly removed from and added to the DOM.
- There is now a
Litintegration for the Form Observer tools via the@form-observer/litNPM package.
- It is now possible to simultaneously
observemultiple forms in differentDocuments/ShadowRoots with a singleFormObserver(or one of its subclasses).
- The
FormObserver,FormStorageObsever, andFormValidityObserverare now able to work with forms inside of a Shadow DOM.- Note: Mixing a single form's controls between the Light DOM and the Shadow DOM (or between multiple distinct Shadow DOMs) is still prohibited because it goes against the Web Standard.
- An
HTMLFormElementmust now be added to the DOM before it can beobserved. (In practice, this will happen naturally/automatically.) - An
HTMLFormElementmust now beunobservedbefore it can be removed from the DOM or relocated to a new root node. (Again, in practice, this will happen naturally/automatically.)