Skip to content

Phone number - is this example possible with react-select? #4562

Answered by ebonow
gino asked this question in Q&A
Discussion options

You must be logged in to vote

Greetings @gino ,

Hope you don't mind that I added this to discussions as this pertains more to implementation rather than logging an issue with the library.

You can use react-select. There is a lot going on in the examples so let me try to break down how I would approach it.

From the looks of it, you aren't really filtering on anything other than the country code/area code. Since this is independent of the actual typed in phone number, I would use the Select only as the dropdown by setting isSearchable=false.

You would also need some kind of masking input.

When the masked input changes, you can parse it to determine if the country/are code changed, and if so, set the value of the select …

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@ebonow
Comment options

@gino
Comment options

@ebonow
Comment options

@gino
Comment options

@ebonow
Comment options

Answer selected by ebonow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4561 on April 30, 2021 15:58.