Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formik conflict with RadioGroup and TextField of MUI #3680

Open
block2k opened this issue Nov 1, 2022 · 1 comment
Open

Formik conflict with RadioGroup and TextField of MUI #3680

block2k opened this issue Nov 1, 2022 · 1 comment

Comments

@block2k
Copy link

block2k commented Nov 1, 2022

Bug report

when entering the textfield or touching the textfield, the error message of the radio group is displayed even though the radio group area has not been touched

Current Behavior

Touch the textfield then untouch, formik.errors display both error message of textfield and RadioGroup even though I haven't touched the radiogroup

Expected behavior

Touch the textfield then untouch, display only error message of textfield

Reproducible example

This is example of this bug
https://codesandbox.io/s/formik-bug-radiogroup-vs-textfield-0tvzcx

Your environment

Software Version(s)
Formik 2.2.9
React 17.0.2
TypeScript no
Browser Chrome
npm/Yarn npm
Operating System Win 10 Pro
@vennilamahalingam
Copy link
Contributor

Refer : https://codesandbox.io/s/formik-bug-select-vs-textfield-forked-9mfdsy?file=/src/App.js
Works alright now.

Any particular reason why you have not included formik.touched for Radio button ?
As per other examples from documentation also, I understand that the validation schema runs for all fields and its up to the user to display the error message after making sure formik.touched exists for that particular field element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants