Skip to content

Comments

fix: prevent SVG clip path ID collisions in multiple QR code instances#252

Merged
MarioExpensify merged 1 commit intoExpensify:mainfrom
linhvovan29546:fix/clippath-unique
Dec 4, 2025
Merged

fix: prevent SVG clip path ID collisions in multiple QR code instances#252
MarioExpensify merged 1 commit intoExpensify:mainfrom
linhvovan29546:fix/clippath-unique

Conversation

@linhvovan29546
Copy link
Contributor

@linhvovan29546 linhvovan29546 commented Dec 2, 2025

Details

Integrated React's useId hook 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} and clip-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

  • I have described the bug/issue
  • I have provided reproduction in Example App
  • I have tested that solution works on Example App on all platforms:
    • Android
    • iOS
    • Web

Screenshots/Videos

Before After
Screen.Recording.2025-12-02.at.10.00.41.mov
Screen.Recording.2025-12-02.at.09.59.52.mov

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@linhvovan29546
Copy link
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
@linhvovan29546 linhvovan29546 marked this pull request as ready for review December 2, 2025 03:23
@linhvovan29546
Copy link
Contributor Author

cc @MarioExpensify @sobitneupane

@sobitneupane
Copy link

@MarioExpensify Good to merge.

@MarioExpensify MarioExpensify self-requested a review December 4, 2025 20:14
@MarioExpensify
Copy link
Contributor

All good, let's move forward with merge!! Thank you @sobitneupane

@MarioExpensify MarioExpensify merged commit 1ba382b into Expensify:main Dec 4, 2025
4 checks passed
@os-botify
Copy link
Contributor

os-botify bot commented Dec 4, 2025

🚀 Published to npm in 6.3.21 🎉

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.

3 participants