Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contact form: Fix problem when inserting phone number that begins wit…
…h same digits as country code (#54477) The phone input field in the domain contact information form has had a problem for some time (issue #25039): when a user tries to input a phone number which begins with the same digits as the selected country's international dialing code, these numbers are removed from the input. Copy and pasting also doesn't work, the initial digits are removed the same. For example, Brazil's dial code is +55, and a valid Brazilian phone number is 55 1234-5678, 55 being a national city code. However, you can't input that number because the 55 is constantly removed. This PR fixes that behavior by updating the logic of when the international dialing prefix should be removed. Commits: * Add unit tests that reproduce issue #25039 When a user tries to input a phone number which starts with the same digits as the selected country's code, that initial part gets removed. This happens for example for Brazilian (international code +55) phone numbers: if I write 55 12345678 (55 being a valid city code), it gets truncated into 12345678. As reported in issue #25039, this happens for any phone number in the same situation. * Update test-phone-number with some more cases * Update logic to remove dial code prefixes * Add some more test cases
- Loading branch information