Fix transparent QR code patterns in SVG exports when background is disabled#245
Fix transparent QR code patterns in SVG exports when background is disabled#245
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: lyqht <35736525+lyqht@users.noreply.github.com>
- Add backgroundOptions to qrCodeProps with white fallback when transparent - Ensures SVG exports are visible even when With background is unchecked - Fixes issue where exported SVG files were completely invisible Co-authored-by: lyqht <35736525+lyqht@users.noreply.github.com>
|
@copilot this doesn't fix the issue because there are times where we do want the background to be invisible. The user's bug is that the entire SVG is transparent, even the lines/eyes in the qr code when the background is invisible. |
- Add backgroundOptions to qrCodeProps to explicitly set background color - Post-process SVG to ensure QR code patterns have visible fill colors - Preserves user's custom colors while fixing transparency issue - Only modifies pattern elements, not backgrounds Co-authored-by: lyqht <35736525+lyqht@users.noreply.github.com>
You're absolutely right - my initial fix was incorrect. I've updated the solution in commit e6af95d. The new fix:
The issue was that Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
SVG exports had completely transparent QR code patterns (dots, corners, eyes) when "With background" was unchecked, making the entire QR code invisible. The issue was that the
dom-to-svglibrary wasn't preserving fill colors correctly when converting the QR code's SVG elements.Changes
backgroundOptionstoqrCodePropsto pass background color setting to the QR code librarygetSvgString()to ensure QR code pattern elements have visible fill colorsclip-pathattributesResult
Before: Exported SVG with unchecked background had invisible QR code patterns (all transparent)
After:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.