Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Transaction confirmation pop up window fails to open for small mobile. #1390

Closed
jakekidd opened this issue Sep 9, 2024 · 1 comment
Closed
Labels
type: bug Something isn't working

Comments

@jakekidd
Copy link

jakekidd commented Sep 9, 2024

Describe the bug

Transaction confirmation window never opens on a small screen device.

Steps

  1. Use a small device whose window.innerWidth would be less than 420px and/or window.innerHeight would be less than 540px in the browser.
  2. Set up coinbase smart wallet on the device.
  3. Attempt to send a transaction through a web app that would open a pop up window for a transaction confirmation. Observe that nothing happens because of an error opening the pop up window.

Expected behavior

The pop up window opens for transaction confirmation, regardless of device screen size.

Version

latest

Additional info

For this openPopup function in packages/wallet-sdk/src/util/web.ts, for these lines:

  const left = (window.innerWidth - POPUP_WIDTH) / 2 + window.screenX;
  const top = (window.innerHeight - POPUP_HEIGHT) / 2 + window.screenY;

If the device (i.e. the window) has an innerWidth < 420 and/or an innerHeight < 540, as defined at the top of this file, the resulting values for left and/or top will likely be negative (screenX and screenY are typically 0 or close to 0), and the pop up window will fail to open. This prevents support for smaller devices.

Desktop

No response

Smartphone

  • Device: iPhone13
  • OS: iOS 17
  • Browser: safari
@jakekidd jakekidd added the type: bug Something isn't working label Sep 9, 2024
@jakekidd
Copy link
Author

Left and top refer to position, not width and height. My mistake. However, may be worth noting there are cases where the position could be negative, as described in the issue, which may be unintended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

1 participant