medipass / react-payment-inputs

A React Hook & Container to help with payment card input fields.
https://medipass.github.io/react-payment-inputs
341 stars 62 forks source link

fix: allow writing over when text is selected #67

Open alex-vladut opened 3 years ago

alex-vladut commented 3 years ago

Hello 👋 ,

Thanks a lot for putting this library together. We've come across this issue recently that one cannot directly write over a selection of text, and instead they would have to clear the input text first with backspace. I added a fix with this PR so that it will only prevent adding more characters to the text if there is no selection. Let me know please if you think this makes sense and if we could get this fix released. Thanks!