catamphetamine / react-phone-number-input

React component for international phone number input
http://catamphetamine.gitlab.io/react-phone-number-input/
MIT License
924 stars 194 forks source link

can disable only the flag selector? #419

Closed neduardoaguirre closed 1 year ago

neduardoaguirre commented 1 year ago

I am trying to implement this library to manage my phone inputs and I would like to be able to disable only the flag selector. I saw that the readOnly property disables the selector and the input. Is there any way to disable only the flag selector?

catamphetamine commented 1 year ago

To disable the flag selector, use “without country select” component.

On Fri, 4 Nov 2022 at 02:50, Eduardo Aguirre @.***> wrote:

I am trying to implement this library to manage my phone inputs and I would like to be able to disable only the flag selector. I saw that the readOnly property disables the selector and the input. Is there any way to disable only the flag selector?

— Reply to this email directly, view it on GitHub https://github.com/catamphetamine/react-phone-number-input/issues/419, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADUP32I6DRKHJRQAHX4QQDWGRFVZANCNFSM6AAAAAARWVKWGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

neduardoaguirre commented 1 year ago

Thanks for the quick reply, in fact I need to make the flag selector visible but avoid displaying the list, that would be very useful.

catamphetamine commented 1 year ago

Then you'd have to implement your own custom component. This component won't support that for now.

lazardimi commented 11 months ago

Hi there!

I've been using your React phone number input package, and it's been incredibly helpful for my project. However, I've noticed a small issue with the 'ReadOnly' property.

When 'ReadOnly' is set to true, the phone number input becomes non-editable as expected. However, the flag selector dropdown remains active and functional, allowing users to change the country code. It seems like the flag selector should also be disabled when the phone number input is read-only for a more consistent user experience.

It would be great if you could consider adding an option to disable the flag selector along with the phone number input when 'ReadOnly' is set to true. This enhancement would ensure a more consistent and user-friendly behavior when users are not allowed to edit the phone number.

Thanks for your excellent work on this package, and I look forward to seeing this improvement in a future update!

catamphetamine commented 11 months ago

@lazardimi That's an interesting Idea. Thx. Implemented your suggestion in react-phone-number-input@3.3.7.

lazardimi commented 11 months ago

Thanks again for your hard work and for being so responsive to user feedback!