Stripe element gets focus if error occurred in createToken(...)
I'm using CardElement component. When I'm trying to call stripe.createToken(...) and get error (user didn't enter cvc for example) component is autofocused. I do not expect such behaviour, cause stripe input is the last one, and there are inputs that needs to be focused instead stripe if there was an error.
Does someone have thoughts how I can disable autofocus?
@zhdanouskikh, you should be able to override this behavior by sending the focus wherever you like after stripe.createToken has resolved. Take a look at this example:
https://codesandbox.io/s/trusting-worker-ehxnv?fontsize=14&hidenavigation=1&theme=dark
Let me know if this doesn't work for you.
Closing this as this project has migrated to React Stripe.js. If you believe this is still important, please re-open it there.