#Raul-elements

1 messages ยท Page 1 of 1 (latest)

old brook
#

Hi ๐Ÿ‘‹ are you referring to Stripe Elements? If so, which one(s)?

proud jackal
#

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');
});

old brook
#

Gotcha, so you're working with the payment element.

proud jackal
#

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

old brook
#

That ready event that you seem to be listening to should correspond to the element being rendered and ready to receive focus.

proud jackal
#

yes, thats the idea but is not behaving like that

old brook
#

Can you elaborate?

proud jackal
#

that event should trigger when the form is rendered

#

but in some cases is trigering when is not yet rendered

prisma palm
#

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?

proud jackal
#

yes

#

the event triggers without the form rendered

prisma palm
#

How much earlier is it getting triggered?

proud jackal
#

take a while to the form to appear since the event trigger

#

10 seconds at least

prisma palm
proud jackal
#

is pretty fastar

#

faster*

flint parcel
#

You also might want to consider using the change event's complete indicator to enable your submit/pay button

proud jackal
#

i tried the change complete too

#

in the example you pass

#

appeats submit payment

#

and after 20 seconds the form

halcyon raven
#

What browser are you testing this out in?

proud jackal
#

firefox

#

on chrome is faster

halcyon raven
#

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!

proud jackal
#

ok

#

great

#

i was getting crazy ๐Ÿ˜…

halcyon raven
#

So sorry about that! It's a weird behavior for sure

proud jackal
#

is what happen with the differents browsers

#

is ok

#

thank you for the feedback