You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell, Spree.disableSaveOnClick() disables the submit button when the form is submitted, leaving it up to the response handler to re-enable it if the request fails. However, Stripe Elements sometimes seem to invoke the response handler immediately (probably based on cached form state), before Spree.disableSaveOnClick() disables the button, with the effect that the button remains disabled. This can be reproduced like this:
Submit payment form without filling in any fields. This results in an error message and the submit button is re-enabled.
Submit the empty form again.
Fill in valid payment info, try to click the submit button and notice it's disabled.
I tried changing the code that re-enables the submit button in SolidusStripe.Elements.prototype.showError to this
The payment form submit button is created like this in the default _payment.html.erb template
As far as I can tell,
Spree.disableSaveOnClick()
disables the submit button when the form is submitted, leaving it up to the response handler to re-enable it if the request fails. However, Stripe Elements sometimes seem to invoke the response handler immediately (probably based on cached form state), beforeSpree.disableSaveOnClick()
disables the button, with the effect that the button remains disabled. This can be reproduced like this:I tried changing the code that re-enables the submit button in
SolidusStripe.Elements.prototype.showError
to thiswhich seems to solve the problem. It's not very pretty though...
Any ideas about how to proceed with this? Should it be fixed in
solidus_stripe
?The text was updated successfully, but these errors were encountered: