medipass/react-payment-inputs

Focus automatically jumps to expiryDateField

Opened this issue · 2 comments

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:

expiryDateField.current && expiryDateField.current.focus();

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

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

@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.