Skip to content

Commit

Permalink
fix: spacing and only numeric char added
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Apr 26, 2024
1 parent 6a737e2 commit 2af60e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Components/PhoneNumberPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ let make = () => {
let getCountryCodeSplitValue = val => val->String.split("#")->Array.get(1)->Option.getOr("")

let changePhone = ev => {
let val: string = ReactEvent.Form.target(ev)["value"]->String.replaceRegExp(%re("/\+D+/g"), "")
let val: string = ReactEvent.Form.target(ev)["value"]->String.replaceRegExp(%re("/\D|\s/g"), "")
setPhone(prev => {
...prev,
countryCode: valueDropDown->getCountryCodeSplitValue,
Expand Down

0 comments on commit 2af60e9

Please sign in to comment.