#Mike Taylor - Disable Autofocus
1 messages · Page 1 of 1 (latest)
I am going to assume you are talking about elements loaded by Stripe.js. Is that correct?
yes correct
We are seeing the focus shift within a form to the Stripe element. And looking to override that refocus.
So when a user enters a completed card number but that number is incorrect?
for example
yes or even just a incompete card number
I don't know if a class string approach will get you there (and I don't really know what classes you would use anyway). However, we do configure the change event to include details on all the data entered by the end-user.
https://stripe.com/docs/js/element/events
You could use this approach to force the user back to the incorrectly entered field (I think).
We are looking to "turn off" the card element event based focus behaviour. Is the parameter in the CardElement options to do this?
I do not think this is something you can deactivate using the options object at the time of element creation. I suspect your best bet would. be to experiment with the different events to see which fires when you want to prevent the focus shift and re-focus back on the offending input