diff --git a/packages/keychain/src/components/NavigationHeader.tsx b/packages/keychain/src/components/NavigationHeader.tsx index edff50a3d..c26a9d855 100644 --- a/packages/keychain/src/components/NavigationHeader.tsx +++ b/packages/keychain/src/components/NavigationHeader.tsx @@ -24,9 +24,11 @@ export function NavigationHeader({ // Check if we're in an iframe const isInIframe = window.self !== window.top; - // Determine which button to show based on navigation state + // Determine which button to show based on navigation state. + // In iframe/popup context, prefer close over back by default. const shouldShowBack = - forceShowBack || (canGoBack && !forceShowClose && !showClose); + forceShowBack || + (!isInIframe && canGoBack && !forceShowClose && !showClose); const shouldShowClose = isInIframe && (forceShowClose || showClose || !shouldShowBack);