Code Monkey home page Code Monkey logo

react-telephone's People

Contributors

allcontributors[bot] avatar dependabot[bot] avatar jorisre avatar kcazer avatar renovate[bot] avatar varevarao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-telephone's Issues

How to use with formik?

I don't know if it is possible but how can we see the value typed or selected country in a form? Especially with formik.

Incorrect display format for China

The most common number format used in China is 3/4/4 (XXX XXXX XXXX). Dash (-) is never used here.

In Google's libphonenumber the metadata is like this:

Id                           ; National           ; Carrier           ; International     ; Local       ; National Prefix Optional ; Comment
...
mobile_3/4/4                 ; "XXX XXXX XXXX"    ; "@ XXX XXXX XXXX" ; "XXX XXXX XXXX"   ;             ;                          ; "Mobile range"
...

React hook form works with ...register but not with the Controller syntax

I am trying to get the input to work with the hook form controller component and it throws an error when the defaultCountry value is set.
image

      <Controller
        control={control}
        name="phoneNumber"
        rules={{
          required: 'Please add a phone number',
        }}
        render={({ field, fieldState }) => (
          <Phone {...field} defaultCountry="us">
            <Phone.Country
              className={
                'rounded-br-none rounded-bl-none  focus:border focus:border-gray-300 focus:ring-transparent'
              }
            />
            <Phone.Number
              className={
                'rounded-tr-none rounded-tl-none border-t-0  focus:border focus:border-t-0 focus:border-gray-300 focus:ring-transparent'
              }
            />
          </Phone>
        )}
      />

Here is a sandbox of the issue https://stackblitz.com/edit/github-nhjwbd?file=src/components/samples/ReactHookForm.tsx

Any suggestions or ideas why this may be happening?

Bug when selecting US as phone country

I am receiving the following error message when I am selecting the US as phone number and there is already a number in the input:
Cannot read properties of undefined (reading '3')

Screenshot 2023-05-24 at 17 17 32

See this video here that shows the issue.

It works with other countries. Perhaps it has something to do with the expected format of the input and the German number is too long which was previously in there?

Incorrect display for German numbers

Currently it shows phone numbers like this:

Screenshot 2023-06-13 at 18 16 22

It should be 160 1212123 so it wrongly adds 1 digit too much. Is there a way how I can adjust this or custom render it? One solution could also simply be a setting to deactivate the formatting.

JSX Runtime problem

Hi guys,

It seems that there is a compatibility error with older react version (^16.14.0).

ERROR in ./node_modules/react-telephone/dist/react-telephone.modern.js 1:0-56
Module not found: Error: Can't resolve 'react/jsx-runtime' in 'C:\XXXXXX\node_modules\react-telephone\dist' 
Did you mean 'jsx-runtime.js'?
BREAKING CHANGE: The request 'react/jsx-runtime' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the ppackage.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Bonne journée à vous!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.