Skip to content

onBlur validator hasn't been fired on leaving a field if it has multiple input tags #918

Answered by Balastrong
arturasmckwcz asked this question in Q&A
Discussion options

You must be logged in to vote

For a radio button I'd probably go with an onChange validator, but in your specific case if you want Form to react to blur events you have to pass the handler to your input, like so:

<input
  name="certMeaslesVaccination"
  type="radio"
  onChange={() => field.handleChange(true)}
+ onBlur={field.handleBlur}
/>
<input
  name="certMeaslesVaccination"
  type="radio"
  onChange={() => field.handleChange(false)}
+ onBlur={field.handleBlur}
/>

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@arturasmckwcz
Comment options

@Balastrong
Comment options

@arturasmckwcz
Comment options

Answer selected by Balastrong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants