fix(ticket): mount anchor link to body before clicking to prevent sil… - #10741
Open
Kritika200520 wants to merge 1 commit into
Open
fix(ticket): mount anchor link to body before clicking to prevent sil…#10741Kritika200520 wants to merge 1 commit into
Kritika200520 wants to merge 1 commit into
Conversation
…ent download failures on Firefox
Contributor
|
@Kritika200520 is attempting to deploy a commit to the sandeepvashishtha's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Our agent can fix these. Install it.
No quality gates enabled for this code.
Quality Gate Profile: Custom Configuration
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
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
In
src/components/common/QRTicket/useTicketDownload.js, thedownloadPNGhook handles exporting the ticket image. However, when triggering the download insidecanvas.toBlob(...), it creates a temporary anchorlinkelement and callslink.click()without appending it to the DOM first. Firefox blocks or ignores programmatic click events on unmounted links, causing the ticket PNG download to fail silently on Firefox.This PR fixes the issue by temporarily appending the generated anchor element to
document.bodybefore callinglink.click(), and removing it immediately afterward to ensure cross-browser download compatibility.Fixes #10732
Changes Made
src/components/common/QRTicket/useTicketDownload.js):canvas.toBlobcallback to append the link todocument.bodybefore calling.click()and remove it from the document body right after.Verification
npm run build.