diff --git a/src/digital-components/phonenumber-question/phonenumber-question.vue b/src/digital-components/phonenumber-question/phonenumber-question.vue index ff0bbadd9..7f2525bcb 100644 --- a/src/digital-components/phonenumber-question/phonenumber-question.vue +++ b/src/digital-components/phonenumber-question/phonenumber-question.vue @@ -75,8 +75,13 @@ export default { // Update the phone number with the formatted version return formattedNumber; }, - filterNumber() { - this.selectedValue = this.selectedValue.replace(/1/g, ""); + filterNumber(event) { + const regex = /^(?!1)\d+/; + const inputValue = event.target.value; + if (!regex.test(inputValue)) { + // If the input violates the regex pattern, remove the leading 1 + event.target.value = inputValue.replace(/^1/, ""); + } }, }, watch: {