Skip to content

Releases: zackify/validify

6.1.1

25 Apr 19:13
fd63650
Compare
Choose a tag to compare

Changes

  • Fixed TS error

6.1.0

19 Apr 21:23
553d7be
Compare
Choose a tag to compare

553d7be

Allow passing a single rule instead of an array

before

rules={[required]}

after

rules={required}

Rename UseFieldProps to FieldProps

6.0.4

11 Mar 14:43
16e673e
Compare
Choose a tag to compare

Fixed a bug where unmounted inputs would still be validated on submit 16e673e

added errors to the useSubmit hook

6.0.3

09 Mar 15:34
1d27337
Compare
Choose a tag to compare

Moved rules onto the individual inputs! This api feels so much nicer :D

Breaking changes

Change useField calls from:

let { handleChange, handleBlur, value, errors } = useField(props.name);

to

let { handleChange, handleBlur, value, errors } = useField({name: props.name, rules: props.rules});

Change Form validation from:

  <Form
      values={values}
      onValues={setValues}
      rules={{
        email: [required, email],
        date1: [greaterThanDate2],
        name: [required],
      }}
    >
      <Input name="email" />
      <Input name="name" />
      <Input name="date1" />
      <Input name="date2" />
      <Input name="nested.test" />
      <Submit />
    </Form>

to

<Form values={values} onValues={setValues}>
      <Input name="email" rules={[required, email]} />
      <Input name="name" rules={[required]} />
      <Input name="date1" rules={[greaterThanDate2]} />
      <Input name="date2" />
      <Input name="nested.test" />
      <Submit />
    </Form>

5.7.12

14 Jan 20:42
Compare
Choose a tag to compare

testing auto version

5.7.9

08 Jan 16:47
Compare
Choose a tag to compare

Fix regression caused by missing test case. Ensure fields are only validated after blur, unless initially submitted

5.7.8

08 Jan 16:14
Compare
Choose a tag to compare

Fix bug with validation:

  • hit submit immediately
  • tap a field, change the value to be correct, now change it to be invalid. The error wouldn't show until you blur

The fix:

when hitting submit, mark all fields that have rules as blurred, so validation runs on change

5.7.7

08 Jan 15:53
Compare
Choose a tag to compare

Fix a bug where a rule value was undefined, but the type ensures its a string

5.7.6

02 Jan 19:20
Compare
Choose a tag to compare
  • Let value for handleChange be any type

5.7.5

02 Jan 19:17
Compare
Choose a tag to compare
  • Fix handleChange TS definition
  • Add TS types to internals