Repository navigation
fix: qr code not rendering on iPad Safari in install modal - #1397
Open
ZayanKhan-12 wants to merge 2 commits into
Open
ZayanKhan-12 wants to merge 2 commits into
ZayanKhan-12 wants to merge 2 commits into
Conversation
The QR svg emitted by encodeQR has only a viewBox, so its rendered size comes entirely from the stylesheet. That rule used native CSS nesting, which Safari only supports from 16.5/17.2; older iPad Safari drops the rule, leaving an SVG with no intrinsic size inside a flex container, which WebKit collapses to 0x0. Un-nest the selector and add height/aspect-ratio. Fixes MetaMask#1218 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the install modal showing no QR code on iPad (#1218).
Root cause is a two-part failure:
<svg>fromencodeQR(link, 'svg', …)carries only aviewBox— nowidth/heightattributes — so its rendered size depends entirely on CSS.&-less relaxed form). Older iPad Safari drops the whole rule, leaving an SVG with no intrinsic size inside a flex container — which WebKit collapses to 0×0.The fix un-nests the selector (works in every browser) and adds
height: auto; aspect-ratio: 1 / 1so the square QR keeps its shape. Applied to bothstyle.cssandwidget-wrapper/resetStyles.css, covering bothmm-install-modalandmm-select-modal.Fixes #1218
Testing
yarn workspace @metamask/sdk-install-modal-web build— compiled output now contains#sdk-mm-qrcode svg{width:50%;height:auto;aspect-ratio:1 / 1}(verified indist)🤖 Generated with Claude Code
Note
Low Risk
Scoped CSS-only change for modal QR display with no auth, data, or API impact.
Overview
Fixes invisible QR codes in the install and select modals on iPad Safari by replacing nested
#sdk-mm-qrcode { svg { … } }rules with a flat#sdk-mm-qrcode svgselector instyle.cssandresetStyles.css, so sizing applies on browsers that drop unsupported native nesting.The updated rule keeps 50% width and adds
height: autoandaspect-ratio: 1 / 1so viewBox-only SVGs get a non-zero square layout instead of collapsing in flex. The unreleased changelog notes the fix (#1397).Reviewed by Cursor Bugbot for commit 36b6694. Bugbot is set up for automated code reviews on this repo. Configure here.