Skip to content

Add a blocked event when the checkout window is blocked - #835

Open
kyle-schellen wants to merge 1 commit into
ks-web-blocked-popup-sessionfrom
ks-web-blocked-popup-event
Open

kyle-schellen wants to merge 1 commit into
ks-web-blocked-popup-sessionfrom
ks-web-blocked-popup-event

Conversation

@kyle-schellen

@kyle-schellen kyle-schellen commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What changes are you making?

Stacked on #791. Retarget to main once it merges.

When the browser blocks the checkout window, the component now dispatches a blocked event. With #791 alone, stores that hide the overlay get no signal at all, and no store can track how often checkout is blocked.

  • blocked fires on every blocked attempt, including retries, whether or not the overlay is shown. It bubbles and has no detail, like close.
  • Stores that hide the overlay can show their own message. A retry has to come from a user action such as a click.
  • Calling open() directly from a blocked listener is ignored with a warning. Without that guard, the call is blocked again and recurses until the browser throws "Maximum call stack size exceeded".
  • New public API: ShopifyCheckoutBlockedEvent and a blocked entry in ShopifyCheckoutEventMap. The README events table and the sample app's event log include it.

How to test

  • dev web test and dev web lint. New tests cover blocked with the overlay shown and hidden, and the ignored open() call from a listener.
  • Sample app (pnpm sample): under Flow, choose Use existing checkout source and paste a cart permalink. Run window.open = () => null in the DevTools console, then click Open checkout: blocked appears in the Events panel. Reload to undo.
  • To see it with the overlay hidden, also run document.head.append(Object.assign(document.createElement('style'), { textContent: 'shopify-checkout::part(overlay) { display: none; }' })) before clicking Open checkout. No overlay appears, and blocked still fires.

Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/web/README.md)

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 25, 2026
@kyle-schellen kyle-schellen self-assigned this Sep 25, 2026
@kyle-schellen
kyle-schellen marked this pull request as ready for review September 25, 2026 20:08
@kyle-schellen
kyle-schellen requested a review from a team as a code owner September 25, 2026 20:08
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Web — Coverage Report

Lines Statements Branches Functions
Coverage: 97%
95.42% (417/437) 84.33% (210/249) 97.34% (110/113)

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
Web npm tarball 91.6 KiB 92.1 KiB +502 B
Web file breakdown
File Base Head Delta
dist/index.js.map 251.7 KiB 252.8 KiB +1.0 KiB
dist/custom-elements.json 49.8 KiB 51.1 KiB +1.4 KiB
dist/index.d.ts 47.8 KiB 48.0 KiB +265 B
dist/index.js 43.2 KiB 43.5 KiB +345 B
README.md 20.6 KiB 21.0 KiB +337 B
package.json 2.9 KiB 2.9 KiB 0 B
LICENSE 1.1 KiB 1.1 KiB 0 B

Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report.

@kyle-schellen
kyle-schellen added this pull request to stack #837 September 28, 2026 13:15
@kyle-schellen
kyle-schellen force-pushed the ks-web-blocked-popup-event branch from 33a26ff to 684898d Compare September 28, 2026 15:03
@kyle-schellen
kyle-schellen force-pushed the ks-web-blocked-popup-event branch from 684898d to b83b70d Compare September 28, 2026 16:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant