medipass / react-payment-inputs

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

Focus automatically jumps to expiryDateField #30

Open lakesare opened 4 years ago

lakesare commented 4 years ago

When we have an order of inputs like this: image and we input the valid card number, focus is automatically switched to the expiryDateField, missing the custom name field. This happens because of this line: https://github.com/medipass/react-payment-inputs/blob/687df514f2ed406b8d24ec2f9537c110f1db694c/src/usePaymentInputs.js#L117

Expected behaviour: automatic focusing can either be disabled, or we can specify the ref for the next-focus-element ourselves.

Hopp3r commented 4 years ago

@jxom should this be closed since the autofocus parameter was added?

macaetano commented 3 years ago

@jxom should this be closed since the autofocus parameter was added?

It was added to the code, but it should be added to the docs as well.