- Enable
radiogroup
s to properly partake in field revalidation.
- Field revalidation is now supported with the
FormValidityObserver
via therevalidateOn
option. - You can now pass
null
to thetype
argument of theFormValidityObserver
to 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
'stype
constructor argument. - The
useFormValidityObserver
React hook has been removed because it isn't genuinely useful. The new recommendation is to replace all calls touseFormValidityObserver
with 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
render
function to render error messages to the DOM. See this PR for additional details.)
- Fixed a bug in
@form-observer/react
'suseFormValidityObserver
function where updates to thedefaultErrors
option 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
renderer
function for@form-observer/solid
to take into account the coreFormValidityObserver
's new error-clearing behavior inv0.7.0
.
- The
clearFieldError
method has been refactored to call theFormValidityObserver
'srenderer
function withnull
. This change will allow the coreFormValidityObserver
to leverage a given JS Framework'srender
function more seamlessly.
- There is now a
Preact
integration for the Form Observer tools via the@form-observer/preact
NPM 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
autoObserve
d form is repeatedly removed from and added to the DOM.
- There is now a
Lit
integration for the Form Observer tools via the@form-observer/lit
NPM package.
- It is now possible to simultaneously
observe
multiple forms in differentDocument
s/ShadowRoot
s with a singleFormObserver
(or one of its subclasses).
- The
FormObserver
,FormStorageObsever
, andFormValidityObserver
are 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
HTMLFormElement
must now be added to the DOM before it can beobserved
. (In practice, this will happen naturally/automatically.) - An
HTMLFormElement
must now beunobserved
before it can be removed from the DOM or relocated to a new root node. (Again, in practice, this will happen naturally/automatically.)