Merge pull request #1187 from Safelite/CSR-1479-fix-leading-number-one-prevent
CSR-1479 fix regex that prevents using number "1" as the...
This commit is contained in:
commit
eedcd0ab20
1 changed files with 7 additions and 2 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue