#Raul-elements
1 messages ยท Page 1 of 1 (latest)
hi
i have it like this
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
const form = document.getElementById('payment-form-stripe');
paymentElement.on('ready', function(event) {
$('#submit').prop( "disabled", false).html('Enviar');
});
Gotcha, so you're working with the payment element.
si
yes
in many conections the redering is in the moment
but others take some time and have some delay betwen the ready event and the actual rendering
That ready event that you seem to be listening to should correspond to the element being rendered and ready to receive focus.
yes, thats the idea but is not behaving like that
Can you elaborate?
that event should trigger when the form is rendered
but in some cases is trigering when is not yet rendered
So what error are you running in to when you do something off of that event?
Is the submit button being enabled way too early?
How much earlier is it getting triggered?
I am surprised elements is taking that long to render. Does it do that for you on our docs pages as well? https://stripe.com/docs/payments/payment-element
Can you check this react example @proud jackal ?
https://stripe-tinydemos-react-payment-element.glitch.me/
You also might want to consider using the change event's complete indicator to enable your submit/pay button
i tried the change complete too
in the example you pass
appeats submit payment
and after 20 seconds the form
What browser are you testing this out in?
Gotcha - we recently discovered something on Firefox where for some folks it was taking a bit longer to render. They should have a fix out for it soon!
So sorry about that! It's a weird behavior for sure