viclafouch / mui-tel-input

📌 A phone number input designed for MUI (Material ui) V6 built with libphonenumber-js
https://viclafouch.github.io/mui-tel-input
MIT License
160 stars 65 forks source link

Using setValue() from React Hook Form still triggers formatting despite disableFormatting is true #87

Closed BoreasHe closed 11 months ago

BoreasHe commented 1 year ago

Minimal Reproducible Example

https://codesandbox.io/s/xenodochial-noyce-kgqr7l?file=/src/App.js:926-943

Note: I used the example from https://viclafouch.github.io/mui-tel-input/docs/react-hook-form/ and added some lines.

Steps to Reproduce

  1. Check that the disableFormatting prop is true in MuiTelInput component.
  2. Try to type something inside the input box. The disableFormatting should work as intended.
  3. Click the "Set Value!" button. Now you can see the 8-digit tel no. is separated by a space character.
  4. The error message indicates that the input is invalid.
viclafouch commented 11 months ago

Hey !

It will be fixed in the next release !

Thanks @BoreasHe :))

000xuandu commented 10 months ago

Hey @viclafouch I am facing this error also. Is there any way to fix this error without upgrading ReactJs to v18?

"mui-tel-input": "^3.2.1",
"react": "^17.0.0",
viclafouch commented 10 months ago

Hello !

Nah, React 17 is not compatible anymore

deepanAppycodes commented 10 months ago

I am getting an error when using mui-tel-input with react hook form. It says Mn is not defined. image

viclafouch commented 10 months ago

Please create a new issue with a codesandbox.