podkrepi-bg / frontend

Charity platform https://podkrepi.bg Docs https://docs.podkrepi.bg
https://podkrepi.bg
MIT License
177 stars 88 forks source link

Card holder name restriction #1975

Closed katina-anachkova closed 4 days ago

katina-anachkova commented 2 weeks ago

Closes #1761

Motivation and context

Enhance the component's usability for individuals with varying levels of technical expertise by adding an onInput handler that removes non-letters, non-spaces, and non-hyphens, and replaces consecutive hyphens/spaces with a single character.

Screenshots:

Before After
image image

Testing

Steps to test

  1. Go to a donation page
  2. Choose card payment
  3. Try adding numeric/other symbols in the name input field. Only Letters, spacing and hyphens should be allowed

Tested with different name combinations in regex 101 tool.

github-actions[bot] commented 2 weeks ago

✅ Tests will run for this PR. Once they succeed it can be merged.