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

Disappearing flag and useless props #473

Open
pavdev64 opened this issue Mar 4, 2025 · 1 comment
Open

Disappearing flag and useless props #473

pavdev64 opened this issue Mar 4, 2025 · 1 comment

Comments

@pavdev64
Copy link

pavdev64 commented Mar 4, 2025

  1. Some props like classNames, className and pattern are required and shouldn't be.
import { Country, ReactTelephoneInput } from 'react-telephone-input';

    <ReactTelephoneInput
      classNames={''}  // why required?
      className={''}  // why required?
      pattern={''}  // why required?
      inputId="rti"
      inputProps={{ name: 'phone' }}
      defaultCountry="fi"
      preferredCountries={['fi', 'se']}
      onChange={handleChange}
      value={value}
    />
  1. If I add the number 1 to the input containing +358, so that the input has the value +3581, the Finnish flag changes to the country of Åland Islands, which does not have a flag image.

Can be reproduced with the second input on https://unstack.in/react-telephone-input/

Image

Version of react-telephone-input
5.0.0

Browser
The latest chrome, but shouldn't matter.

Expected behavior
The props are not required in Typescript and Finland flag not changed to Åland Islands.

Note: The version 4.73.0 works ok, but causes the following error in react 18.2.0:

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of ReactTelephoneInput which is inside StrictMode. Instead, add a ref directly to the element you want to reference.
@pavdev64
Copy link
Author

pavdev64 commented Mar 5, 2025

Well, it seems all versions are not compatible with the react strict mode.
And the flag/country changing issues started with version 4.74.4.
This could be because new countries with duplicate area codes were added (for example Åland Islands which has the same area code as Finland +358).

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

No branches or pull requests

1 participant