Releases: twisty/formsy-react-components
v1.0.0-alpha.2
Components are now named exports, restoring the interface from 0.x releases. For example:
import { Textarea } from 'formsy-react-components';
Install
npm install formsy-react-components@next
v1.0.0-alpha.1
v0.10.1
v0.10.0
- Add new
validateOnSubmit
prop. Thanks to @almassapargali for contributing this. - Fix for #93: 'Type is invalid when creating a Form'
validateOnSubmit
prop.
When true
, validation notices are hidden until the user attempts to submit the form. This prop can be passed to individual components, or set for all components in the form via the parentContext
mixin.
v0.9.0
v0.8.1
v0.8.0
- Support for
<optgroup>
in<Select />
component (@Reltik) - Replaced old-style string refs with new-style callback refs (@shilman, @SachaG)
<optgroup>
in the <Select />
Component
See the test file for details.
Component Refs
Refs to the form controls are now generated via callbacks. See The ref String Attribute for more details.
Breaking change: targeting the component's form control via the refs
key no longer works. You will need to update your code:
// old
myComponent.refs.element
// new
myComponent.element
- For components that wrap a single element (
<Input />
,<Select />
,<Textarea />
etc.) theref
is named "element
". - For components that wrap multiple form elements (
<CheckboxGroup />
,<RadioGroup />
) each form control has a ref named "element-
" and then the name of the key for that element, e.g.element-foo
.
v0.7.1
v0.7.0
- Added
ref
to form elements. (b5566af) - The asterisk symbol for "required" is now targetable via CSS. (28c049b)
- The symbol is now wrapped in a span:
<span class="required-symbol"> *</span>
- The symbol is now wrapped in a span:
- Add
data-required
html attribute to the label tag to make it targetable via CSS. (c101bce) - Use the React convention of returning
null
for things that we don't want rendering.- Warning: Previously we were returning an empty string that caused a few empty
<span />
elements to be peppered about. While unlikely, this may break your layout if you have CSS that depends on these empty<span />
s being present (like:nth-child
selectors).
- Warning: Previously we were returning an empty string that caused a few empty
Thanks to everyone that has took the time to file issues and provide feedback.
Component Refs
Each component has a ref
to it's form control elements.
- For components that wrap a single element (
<Input />
,<Select />
,<Textarea />
etc.) theref
is named "element
". - For components that wrap multiple form elements (
<CheckboxGroup />
,<RadioGroup />
) the each form control has a ref named "element-
" and then the name of the key for that element, e.g.element-foo
.
Warning: Previously, the refs to form elements in the <CheckboxGroup />
were not prefixed with element-
, if you have code used these refs
, you'll need to update it.