Formik: Touched is not set on radio buttons on initial change

Created on 26 Oct 2018  路  5Comments  路  Source: formium/formik

馃悰 Bug report

Current Behavior

I would expect for touched to be set as soon as I click on a radio button, but this seems to happen on blur instead of onChange.

You can reproduce this below, select the radio button and note that touched is unchanged. Blur the element and touched will be set.

Expected behavior

I expect touched to be set as soon as I change the input

Reproducible example

https://codesandbox.io/s/42y1nzm9xw

Suggested solution(s)

Perhaps touched should be set onChange instead of onBlur?

Your environment

| Software | Version(s) |
| ---------------- | ---------- |
| Formik | 1.3.1
| React | 16.4.2
| Browser | Chrome 70.0.3538.77
| npm/Yarn | yarn 1.10.1
| Operating System | OSX 10.14

stale

Most helpful comment

@jaredpalmer I think this issue should still be open

All 5 comments

Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal.

ProBot automatically closed this due to inactivity. Holler if this is a mistake, and we'll re-open it.

@jaredpalmer I think this issue should still be open

Definitely still an issue. Bump?

Also an issue with checkbox. It's only after you click somewhere else touched is set. While dirty and values are set after onChange. I would expect for touched to be set as soon as I click the chechbox.

Example modified after @gzzo
https://codesandbox.io/s/formik-example-wkd6w

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredpalmer picture jaredpalmer  路  3Comments

pmonty picture pmonty  路  3Comments

PeerHartmann picture PeerHartmann  路  3Comments

jaredpalmer picture jaredpalmer  路  3Comments

green-pickle picture green-pickle  路  3Comments