fix: prevent SVG clip path ID collisions in multiple QR code instances#252
Merged
MarioExpensify merged 1 commit intoExpensify:mainfrom Dec 4, 2025
Merged
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
CLABotify
added a commit
to Expensify/CLA
that referenced
this pull request
Dec 2, 2025
Contributor
Author
8 tasks
14b1f0d to
1cb1a2f
Compare
sobitneupane
approved these changes
Dec 4, 2025
|
@MarioExpensify Good to merge. |
MarioExpensify
approved these changes
Dec 4, 2025
Contributor
|
All good, let's move forward with merge!! Thank you @sobitneupane |
Contributor
53 tasks
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.
Details
Integrated React's
useIdhook to generate unique clip path IDs for each QR logo component instance. Each QR logo now has unique identifiers for its SVG clip paths (clip-logo-background-{id}andclip-logo-{id}), preventing ID collisions when multiple QR codes are rendered on the same page.What this fixes
Issue: Expensify/App#74794
Proposal: Expensify/App#74794 (comment)
As shown in the screenshots below, the "Before" example demonstrates the bug: all QR code logos render with rounded even though the border radius is only specified for one logo. This happens because all instances share the same clip path IDs, causing the styling to leak across logo. After this fix, the border radius correctly applies only to the intended logo, while other logos remain unaffected.
Checklist
ExampleAppExampleApp on all platforms:Screenshots/Videos
Screen.Recording.2025-12-02.at.10.00.41.mov
Screen.Recording.2025-12-02.at.09.59.52.mov