Changelog
1.7.5
September 5, 2021
🐛 Fixed error messages not marking fields as visited. Most people would never see this bug.
1.7.4
September 1, 2021
🐛 Fixed a bug where
onSubmit
wouldn't execute onOneForm
if it was passed intoSubform
.
1.7.3
August 30, 2021
🐛 Changed
useLayoutEffect
touseMemo
with a side-effect.
1.7.2
August 30, 2021
🐛 Fixed a bug where passing
updatedValues
orvalues
bothOneForm
andSubform
would only take the values inSubform
.
1.7.1
August 26, 2021
🐛 Added missing
Subform
anduseSubformEffect
to the library export.
1.7.0
August 26, 2021
✨ Added
Subform
as a way of passing props toOneForm
without returning them back up the chain.🐛 Fixed a bug where OneForm would stop working if
groupValidations
received an updated value.
1.6.0
August 24, 2021
✨ Added
getErrorMessages
touseFormSubmission
.✨ Added
isVisited
touseFormSubmission
.✨ Added
submitForm
touseFormSubmission
.
1.5.1
August 18, 2021
✨ Added a console error when
name
isundefined
.🐛 Fixed a bug where passing a non-object from
onChange
(instead of an input event) would cause an error.
1.5.0
August 17, 2021
✨ Improved tree-shaking by defining the library as side-effect free and not-bundling the ESM files.
🐛 Fixed an error which occurred when
onChange
doesn't receive a validInputEvent
.
1.4.0
July 27, 2021
✨ Added
IfFieldErrorMessage
.✨ Added
IfFieldValue
.✨ Added
IfFieldVisitation
.🐛 Fixed a bug in OneForm where visitation state isn't set from
values
on first mount.
1.3.0
July 27, 2021
✨ Added multi-element support for checkboxes that share the same
name
prop.✨ Unchecked string-value checkboxes are marked with the string
unchecked
instead offalse
per the HTML spec.
1.2.0
July 26, 2021
✨ Added
translateProps
prop toField
. This allows creating newField
components without relying onuseField
.✨ Added
MaterialUiField
. This removes console errors from usingField
.
1.1.1
July 26, 2021
🐛 Fixed a bug where isVisited was returning a string instead of a boolean.
1.1.0
July 24, 2021
💥 Separated boolean logic from
FieldValue
intoIfFieldValue
. This feature was never documented.💥 Separated boolean logic from
FieldErrorMessage
intoIfFieldErrorMessage
. This feature was never documented.
1.0.3
July 23, 2021
🐛 Fixed a bug where initial checkbox values weren't set correctly.
🐛 Fixed a bug where checkboxes are switching between controlled and uncontrolled if they have undefined values.
🐛 Fixed the
Subfield
export importingSubmitField.jsx
.
1.0.2
July 22, 2021
🐛 Fixed issue where some checkboxes wouldn't check because it was incorrectly passing the
value
prop rather than thechecked
orisChecked
prop.
1.0.1
July 22, 2021
🏗️ Added
useIsCheckboxElement
to library export🏗️ Added
useIsHtmlElement
to library export🏗️ Added
Subfield
to library export🏗️ Added
useSubfield
to library export
1.0.0
July 21, 2021
💥 Modified
useField
to take an object, not children.💥 Modified
useFormSubmission
to take no args rather than children.💥 Modified
useSubfield
to take an object, not children.
0.7.1
July 21, 2021
♻️ Minor refactor in
useIsHtmlElement
.
0.7.0
May 25, 2021
💥 BREAKING CHANGE Renamed callback functions in
useField
.✨ Set an
input
'schecked
attribute if it has avalue
attribute.✨ Added Subfield component for multiselect behavior.
0.6.2
May 24, 2021
🐛 Fixed a bug where the radio button's value was changing.
0.6.1
May 22, 2021
🐛 Built prior to publishing so new radio button functionality is available to use.
✨ Added missing
Children.only
check toField
.
0.6.0
May 22, 2021
✨ Added ability for
Field
anduseField
to properly handle radio buttons (this functionality isn't working until0.6.1
).
0.5.2
April 5, 2021
🐛 Fixed a regression where
onSubmit
no longer passed fields.
0.5.1
April 5, 2021
✨ Added
formChangeState
toSubmitField
.✨ Modified
formValidationState
to be all formerrorMessages
.🐛 Fixed
SubmitField
requiring afallback
prop.
0.5.0
April 5, 2021
✨
Field
marksselect
andmultiselect
as visited on selection.✨
Field
correctly handlesmultiselect
values as an array.✨
groups
andgroupsString
are now available in agroupValidations
'sgetErrorMessages()
function. This allows getting IDs forgroupNames
values when returning error messages.
0.4.2
April 5, 2021
✨
SubmitField
disables itself when submitting.
0.4.1
April 5, 2021
✨
SubmitField
is now available for wrapping buttons. It gives information about the form's submission state; something previously not available.
0.4.0
April 5, 2021
✨ 'useFieldRegistration' is now exported.
✨ 'useFieldVisitation' is now exported.
✨ 'useFormSubmission' is now exported.
0.3.2
April 5, 2021
🐛 Subsequent values from
onChange
are now correctly being set as visited.🐛
updatedValues
is now correctly setting those values to visited.
0.3.1
April 5, 2021
🐛 Fixed a bug where passing
values
caused all values to first get set toundefined
and then given a new value if passed. Now, this is done in a single step, so it will only set to the values passed orundefined
, not both.🐛 Fixed a regression where returned
values
fromonChange
weren't modifying OneForm's state.🐛 Fixed a bug where passing
errorMessages
would remove all other origins. Now it properly only clears the external origin oferrorMessages
andupdatedErrorMessages
.
0.3.0
April 5, 2021
✨
FieldValue
andFieldErrorMessage
can now renderchildren
intochildren
.✨
FieldValue
andFieldErrorMessage
now optionally take afallback
andgetIsVisible
prop.✨ Error messages now use the same signature as the return value from
groupValidations
meaning they can betrue
, a string, or an array of strings. The array no longer needs to contain valid values either. If passedfalse
,null
, orundefined
, those error messages are skipped.✨
Field
now sets different props depending on if it's been given an HTML element or React component.🐛
Field
now setserror
as a boolean rather than a string. This fixes errors in Material-UI'sTextInput
.🐛 Fixed a bug where checkboxes weren't set to visited on mount which is required for validating against them. This was fixed by looking for a checkbox input or a component with "checkbox" in the name.
0.2.2
March 29, 2021
🐛 Fixed a bug where multiple
groupValidations
that shared the samefieldNames
andgroupNames
(in the same order) would have conflicts on which errors would show and which wouldn't show.
0.2.1
March 29, 2021
📝 Added logo to README on npm.
0.2.0
March 29, 2021
💥 API changes:
validations
now takes agetIsValid
function rather thanvalidate
. This function now receives an object with avalues
prop.groupValidations
takes agetErrorMessages
function and the return value is now anerrorMessages
object, the same as you pass intoOneForm
with the only difference being you can return a string rather than an array of error messages.
There were quite a few bugs with
groupValidations
. Those are fixed in this version.🐛 There's currently one issue with
groupValidations
:If you have two which take the exact same field names (and they share or both don't have
groupNames
, their errors will interfere with each other.This will be fixed in a later update.
A workaround is to change the order of
fieldNames
andgroupNames
your validations.
♻️ The entire error message system has been completely rewritten from the ground up.
Last updated