Skip to content

Releases: willowtreeapps/react-formable

2.3.0

17 Jul 19:39
af00bc6
Compare
Choose a tag to compare

Form instances now have a public method reset, if called it clears all form elements.

2.2.0

11 Jul 15:38
Compare
Choose a tag to compare

We now pass down all properties given to Error to its underlying ul tag

V2

31 Dec 14:47
d63e480
Compare
Choose a tag to compare
V2

Long overdue, we bumped the major version. We have been using this in production with a stable API for two years now. Any future changes will be semvared.

Validation bugs

06 May 22:17
Compare
Choose a tag to compare
Validation bugs Pre-release
Pre-release

This release has the potential to introduce regressions in validation. I am going to cut the major release soon to avoid any further conflicts.

Before we would default the value passed to validators to an empty string if the value itself was falsey. This caused issues with true falsey values such as 0 and false. Now, we don't default value to anything which means you need to check if it exists before you test it.

IE support

10 Feb 16:05
Compare
Choose a tag to compare
IE support Pre-release
Pre-release

Lowers target version down to es5 for better support in IE

Minor bug fixes

02 Feb 19:32
Compare
Choose a tag to compare
Minor bug fixes Pre-release
Pre-release

This bump fixes a few small bugs and missing inputs:

  1. Pressing enter in a textarea no longer triggers onSubmit
  2. Prevents the form from validating with the default HTML validators
  3. Passes down extra props to the form (className, etc)

onSubmit changes

18 Jan 19:15
Compare
Choose a tag to compare
onSubmit changes Pre-release
Pre-release

Two notable changes here:

  1. Changed the types for react to not be included in the build (needs more testing)
  2. The form no longer calls onSubmit if the form is invalid. You can optionally supply noValidate to the form, this will then call onSubmit regardless of the form state with validation as its second parameter.

V2 Alpha Release

13 Jan 19:50
Compare
Choose a tag to compare
V2 Alpha Release Pre-release
Pre-release

We are bumping this to 2.0 to avoid any conflicts / confusions with people already on the 1.0 branch.

Notable changes

The API is experimental at this point, so use with caution. Names could change, however the general structure may change.

  • We have moved away from using refs for inputs. Now instead of needing to define getValue on each of your inputs, you should have onChange which returns the standard event. This means formable works with native inputs (and more) out of the box and plays nicely with decorated components. You can customize how this behaves to accommodate any input. If you want to attach a ref to an input, use callback refs.
  • Validation accepts promises. This is similar to how 1.0 worked
  • No more Fieldset or Fieldlist. Now, you can attach name to any tag and it will start a new context. Similarly, if you have multiple inputs with the same name, it will turn them into an array.
  • Debounced and dirty validation. You can now optionally debounce validation as well as only validate dirty fields. This allows for better experience with showing errors on change.
  • Much more customization. You can customize almost every aspect for formable now. From how errors get passed down to individual inputs, to how various inputs serialize, and more.

Gotchas

There are a few things that have changed from 1.0 that could cause issues.

  • On change now optionally receives fieldErrors. Since validation is debounced, onChange has a new signature:
type validation = { valid: boolean, fieldErrors: any, errors: any[] }
type onChange = (fieldValues: any, validation?: validation) => void
  • Dynamic inputs: Errors will not propagate correctly for dynamically growing rows of dynamically growing inputs. This is a known bug.
  • undefined values in serialization. If you don't provide a value or defaultValue (or checked / defaultChecked) then serializing the form with unchanged inputs now returns undefineds instead of empty strings. For validation, we default this to an empty string. This could prove an issue if you have custom inputs with built in default values which don't get passed down as props.

Release 0.7.1

14 Apr 19:41
Compare
Choose a tag to compare

Two minor bugfixes:

  • #72: Inputs now recive onChange and onSubmit callbacks appropriately when they are in a Fieldset or Fieldlist
  • #70: Fixes an issue where errors were getting dropped on cloning props

Release 0.7

04 Apr 18:24
Compare
Choose a tag to compare

A bugfix release, bumping the minor version to fix some versioning issues.

See PR #69 for more details