Skip to content

Commit

Permalink
allow hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
Katina Anachkova committed Nov 11, 2024
1 parent b36df31 commit 985147a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export default function PaymentDetailsStripeForm({
placeholder={t('donation-flow:step.payment-method.field.card-data.name-label')}
onInput={(e) => {
const input = e.target as HTMLInputElement
if (!/^[a-zA-Z\s]+$/.test(input.value)) {
input.value = input.value.replace(/[^a-zA-Z\s]/g, '')
}
input.value = input.value
.replace(/[^a-zA-Z\s-]/g, '')
.replace(/[-\s]{2,}/g, (match) => match[0])
}}
/>
</Box>
Expand Down

0 comments on commit 985147a

Please sign in to comment.