Experiencing an issue with tab index not working properly when using Vue.js and having a stripe card-element inside the Vue main element. Below is the code snippet:
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://js.stripe.com/v3/"></script>
</head>
<body>
<input type="text" placeholder="first tab element on page"><br />
<br />
<div id="stripeDiv">
<div id="card-element" style="border: 1px solid black;max-width:300px">
<!-- A Stripe Element will be inserted here. -->
</div>
<div id="card-errors" role="alert"></div>
</div>
<br />
<input type="text" placeholder="tab element after stripe form"><br />
<script>
var stripe = Stripe("somestripepublickey");
var card = stripe.elements().create('card').mount('#card-element');
var vue_test = new Vue({
el: '#stripeDiv'
});
</script>
</body>
</html>
Upon tabbing through, the focus shifts to the top input box right after exiting the stripe fields instead of the intended bottom input box.
One possible solution is to use JavaScript with onfocus, although alternative approaches are preferred.
Note: Testing can be done without requiring a Stripe account.