-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Textarea value
error with 3 options not working
#1889
Comments
@Kikketer - Option 2: I suspect Formik v2 isn't compatible with that standard react mechanism, in the case of textarea, due to how formik v2 accesses its field values, vs. React DOM's special logic for textarea. I'm still trying to grasp the details - but try rewriting your test based on the code at Formik v2 Tutorial - Final - codesandbox. Note that the code is different from what is described in the Formik Tutorial. Specifically, each component does: I've confirmed that this works also with
Usage: At debugger breakpoint, I see that |
Fixed in 2.x |
any working code example with v2 please ? i tryed :
i didn't display like other input with style |
🐛 Bug report
Current Behavior
The example in sandbox: https://codesandbox.io/embed/formik-example-q07ty
I'm attempting to make a simple
<textarea>
in a Formik form. However there are three options to do such a thing but none of them work as expected.Option 1: Use
type="textarea"
as described in this ticket: #1237<input type="textarea"
which defaults to text since the browser doesn't know what that meansOption 2: Use a real
<textarea
but addvalue=
as a prop.Option 3: The HTML way of making the value the children of the text area
<textarea>{values.example}</textarea>
Expected behavior
The following code should work as a child of Formik and a form for textareas:
Reproducible example
https://codesandbox.io/embed/formik-example-q07ty
Suggested solution(s)
I'm not sure exactly why the
onChange
is not being accepted and not updating the value in the textarea. But when onChange (orKeyUp) fires inside a textarea the values should be handled properly.Additional context
Your environment
The text was updated successfully, but these errors were encountered: