Skip to content

fix(ticket): mount anchor link to body before clicking to prevent sil… - #10741

Open
Kritika200520 wants to merge 1 commit into
SandeepVashishtha:masterfrom
Kritika200520:fix/ticket-download-firefox
Open

fix(ticket): mount anchor link to body before clicking to prevent sil…#10741
Kritika200520 wants to merge 1 commit into
SandeepVashishtha:masterfrom
Kritika200520:fix/ticket-download-firefox

Conversation

@Kritika200520

Copy link
Copy Markdown
Contributor

Description

In src/components/common/QRTicket/useTicketDownload.js, the downloadPNG hook handles exporting the ticket image. However, when triggering the download inside canvas.toBlob(...), it creates a temporary anchor link element and calls link.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.body before calling link.click(), and removing it immediately afterward to ensure cross-browser download compatibility.

Fixes #10732

Changes Made

  • Ticket Download Hook (src/components/common/QRTicket/useTicketDownload.js):
    • Modified the anchor element logic inside the canvas.toBlob callback to append the link to document.body before calling .click() and remove it from the document body right after.

Verification

  • Verified build via npm run build.
  • Tested PNG ticket downloads in Firefox to confirm that downloads initiate successfully.

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown
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.

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added level:beginner 20pts size/XS Extra-small pull request labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved gssoc approved PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Ticket PNG export fails silently on Firefox

2 participants