If you change the country for the billing address, or click the Recalculate shipping button, the Stripe elements disappear because the module JS detaches the behavior.
Braintree fixed this issue in #2890465: Changing the address country (and other #ajax) clears the braintree form by checking the detach trigger, but the same fix didn't work for me here.
Looks like we need to follow what the D7 code did, basically remove the detach method completely, and make the attached behavior skip tokenization if the underlying form is no longer present (cause an existing payment method was selected, etc).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | js_detach_issue-2893928-2.patch | 905 bytes | vasike |
Comments
Comment #2
vasikei was able to get it working with detach
i only add some extra "checks for existence the elements" we want to deal with.
@bojanz: what do you think about this patch?
Comment #4
bojanz commentedThat did the trick, thank you!