- Issue created by @ugas19
- last update
over 1 year ago Build Successful - Status changed to Needs work
5 months ago 2:21pm 2 July 2024 - 🇮🇳India nayana_mvr
The above patch has failed to apply, getting the following error:-
user phone_international % git apply -v phone_international-change_national_mode-3362902-3_0.patch Checking patch js/phone_international.js... error: while searching for: const country = field.getAttribute("data-country"); const geolocation = parseInt(field.getAttribute("data-geo")); const exclude = field.getAttribute("data-exclude"); const only = field.getAttribute("data-only"); const preferred = field.getAttribute("data-preferred"); error: patch failed: js/phone_international.js:5 error: js/phone_international.js: patch does not apply Checking patch src/Element/PhoneInternationalElement.php... Checking patch src/Plugin/Field/FieldWidget/PhoneInternationalDefaultWidget.php...
I tried the following steps in Drupal 10.4.x version:-
- Created a phone international field in Admin/Configuration/People/Account Settings
- Created a new user in Admin/People/Add user with international number +49 30 901820 and saved
- When I accessed the user edit page, it is showing national number '030 901820' with country selected i.e., Germany(+49)
But as per intl-tel-input, it is recommended to leave this option enabled i.e., true, to encourage users to enter their numbers in national format as this is usually more familiar to them and so it creates a better user experience. So instead of adding an option to change
nationalMode
value, I think it would be better to have an option to show the dial code along with the country code selected which will look like this in the edit page:-
I have created a ticket for implementing the same https://www.drupal.org/project/phone_international/issues/3460732 📌 Option to enable country dial code in the input field Needs review . Please check if this is useful.