Have to press twice for deleting the last character of input and twice for enter the first character #3984
Unanswered
vanminhquangtri
asked this question in
General
Replies: 3 comments 4 replies
-
codesandbox |
Beta Was this translation helpful? Give feedback.
1 reply
-
Codesanbox view: |
Beta Was this translation helpful? Give feedback.
0 replies
-
read the doc on: https://react-hook-form.com/get-started#Quickstart in hook form, you don't need to attach onChagne for native input, we are doing that for you. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone. I use React Hook Form to validate my form including many input. Everything is five except one problem that I have to press backspace twice for deleting the last character and twice for enter the first character. For example. If i need to show value of input is 'jonh', then I have to press 'j' twice so that this letter can be shown. And when I delete 'john', a press 1 backspace for 'n', 1 backspace for 'h', 1 backspace for 'o' BUT 2 backspace for 'j'. I thought this is from react hook form because I don't use, it's no problem. Appreciate any help. Thank you so much
my source:
import React, { useState } from 'react'
import { useForm } from 'react-hook-form'
const [product, setProduct] = useState({
name: '',
code: '',
description: '',
price: '',
weight: '',
long: '',
width: '',
high: '',
})
const handleOnChange = function (event) {
{errors.name && (setProduct((prevState) => {
return { ...prevState, [event.target.name]: event.target.value }
})
}
Beta Was this translation helpful? Give feedback.
All reactions