woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

On mobile, specific refresh behavior causes the PayPal button click event to fail / not load #835

Open jessLundie opened 3 years ago

jessLundie commented 3 years ago

Describe the bug

On checkout, when you scroll down to the PayPal button and then refresh the page, after the page jumps the scroll, the PayPal button no longer works. Nothing happens when you click on it, and it appears the click event didn't load.

To reproduce

I was able to reproduce this on my test site (and the customer's site) using Chrome Device mode, but was not able to reproduce this on my iPhone SE.

  1. Place a product in the cart and navigate to checkout
  2. Click the PayPal button and see that PayPal loads
  3. This is key - scroll down to the PayPal button
  4. Refresh the page from that point - the page will load and then return to the PayPal button automatically
  5. Click the PayPal button again and see that there is no working click event now

This behavior only seems to happen as a result of the load -> page scroll location. Refreshing from the top of the page gives you a working PayPal button.

Expected behavior

The PayPal button click event should load, regardless of where / how you refresh the page.

Environment (please complete the following information):

Additional details

Customer reports this behavior with an iPhone XR, no browser information available. 3466737-zen.