Skip to content

Hide SaveBar on unmount synchronously#563

Open
afurm wants to merge 1 commit into
Shopify:mainfrom
afurm:af/fix-savebar-unmount-hide
Open

Hide SaveBar on unmount synchronously#563
afurm wants to merge 1 commit into
Shopify:mainfrom
afurm:af/fix-savebar-unmount-hide

Conversation

@afurm
Copy link
Copy Markdown

@afurm afurm commented May 7, 2026

Summary

  • Hide the App Bridge React SaveBar during unmount with an isomorphic layout effect.
  • Add a patch changeset for @shopify/app-bridge-react.

Why

React passive effect cleanup can run after the ui-save-bar element has been detached. In that case, the App Bridge SaveBar can remain visible after the React wrapper unmounts, leaving navigation blocked and stale Save/Discard handlers visible. Running the unmount cleanup in a browser layout effect keeps the element available while calling hide(), while still using useEffect on the server to avoid SSR layout-effect warnings.

Fixes #532.

Validation

  • mise exec node@24.13.1 -- pnpm install --frozen-lockfile
  • mise exec node@24.13.1 -- pnpm format:check
  • mise exec node@24.13.1 -- pnpm build
  • mise exec node@24.13.1 -- pnpm lint
  • mise exec node@24.13.1 -- pnpm type-check
  • mise exec node@24.13.1 -- pnpm test

@afurm afurm marked this pull request as ready for review May 7, 2026 14:02
@afurm afurm requested a review from a team May 7, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SaveBar from @shopify/app-bridge-react doesn't close itself when unmounted

1 participant