Skip to content

Commit

Permalink
Take pattern attribute of the phone input element into account when…
Browse files Browse the repository at this point in the history
… validating.
  • Loading branch information
mmsaffari authored Jun 1, 2024
1 parent 09628cb commit 07a7d82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export class MvcValidationProviders {
return false;
}

let r = /^\+?[0-9\-\s]+$/;
let r = element.pattern ? new RegExp(element.pattern) : /^\+?[0-9\-\s]+$/;
return r.test(value);
}

Expand Down

0 comments on commit 07a7d82

Please sign in to comment.