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

card number - support setting the input type (specifically to be able to mask the number by type = password) #66

Open zshlomyz opened 3 years ago

zshlomyz commented 3 years ago

Hi, In order to support setting the input type, it only required to change the type prop of getCardNumberProps (ln 159):

type: props.type || 'tel',

and then it can be configured like this:

{...getCardNumberProps({ onChange: handleChangeCardNumber, type: "password" })}

Thanks