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

[Feature]: Restrict Phone Number Length Based on Country Selection in Phone Widget #34787

Open
1 task done
saiprabhu-dandanayak opened this issue Jul 8, 2024 · 4 comments
Assignees
Labels
Enhancement New feature or request Phone Input Widget Issues related to the Phone Input widget Widgets & Blocks Pod This label assigns issues to the widgets & blocks pod

Comments

@saiprabhu-dandanayak
Copy link
Contributor

saiprabhu-dandanayak commented Jul 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Description 

In the current implementation of the phone widget, users can select a country and type a phone number. However, the widget allows users to enter more digits than permitted for the selected country. For example, Indian phone numbers should only have 10 digits, but the current widget allows more than 10 digits. To enhance the user experience and ensure accurate phone number inputs, we need to restrict the number of digits based on the selected country.

Steps to reproduce

  1. Drag and drop the phoneInputWidget
  2. in the property pane select the default country code as India
  3. Now try to enter a random mobile number with 15-20 digits ( it is taking more than 10 digits , but indian numbers have 10 digits only)
  4. We should not allow the user from entering extra digits than the permitted count for respective country.

Screenshot

image

@saiprabhu-dandanayak saiprabhu-dandanayak added the Enhancement New feature or request label Jul 8, 2024
@Nikhil-Nandagopal Nikhil-Nandagopal added the Phone Input Widget Issues related to the Phone Input widget label Jul 8, 2024
@github-actions github-actions bot added the Widgets & Blocks Pod This label assigns issues to the widgets & blocks pod label Jul 8, 2024
@Harshithazemoso
Copy link

hello @Nikhil-Nandagopal
Solution approach :
We will have user input field just below for the default country code where the user can enter the maxDigits for that country ,and based on that input, we will limit the number of digits accordingly.

@Nikhil-Nandagopal
Copy link
Contributor

@Harshithazemoso it should work exactly like max characters in the input widget

@Harshithazemoso
Copy link

okay sure @Nikhil-Nandagopal

@Harshithazemoso
Copy link

Hi @Nikhil-Nandagopal,

We are considering naming the field "Max Length" and adding it to the validation section, similar to the input widget. Could you please review and let us know if we can proceed with this approach?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Phone Input Widget Issues related to the Phone Input widget Widgets & Blocks Pod This label assigns issues to the widgets & blocks pod
Projects
None yet
Development

No branches or pull requests

4 participants