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

Update flag when defaultCountry value is changed #285

Closed
wants to merge 3 commits into from

Conversation

dhanesh-kapadiya
Copy link
Collaborator

This PR adds functionality of updating country flag when defaultCountry props value is updated after component is mounted.

Description

Current version of the project doesn't support the functionality of updating flag when value passed in props defaultCountry is changed.
To support this functionality, I have added a function named updateFlagOnDefaultCountryChange which will pass the value of this.props.defaultCountry as CountryCode in setFlag function.

Event componentDidUpdate determines whether this function should be called or not based on current and previous value of props defaultCountry.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have used ESLint & Prettier to follow the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@coveralls
Copy link

coveralls commented May 13, 2019

Coverage Status

Coverage decreased (-0.3%) to 92.953% when pulling 0336b10 on dhanesh-kapadiya:master into 3f9b3c7 on patw0929:master.

patw0929 added a commit that referenced this pull request Oct 10, 2019
Bug fixes:

* #285: Update flag when defaultCountry value is changed
@patw0929
Copy link
Owner

Merged to master manually and published in v7.0.3.

@patw0929 patw0929 closed this Oct 10, 2019
andrewsantarin pushed a commit to andrewsantarin/react-intl-tel-input that referenced this pull request Feb 2, 2022
Bug fixes:

* patw0929#285: Update flag when defaultCountry value is changed
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

Successfully merging this pull request may close these issues.

3 participants