qrcodejs icon indicating copy to clipboard operation
qrcodejs copied to clipboard

QR code image only gets downloaded successfully on IOS or flagship devices.

Open muhammadnaeemtahir opened this issue 2 years ago • 1 comments

I have recently finished this project using qrcodejs Free QR code generator.

Everything else is fine, but on devices i.e. Android, it throws an error Download fail or an undefined.html file gets downloaded.

muhammadnaeemtahir avatar Sep 15 '22 05:09 muhammadnaeemtahir

Depending on your context you can try this

const downloadQR = () => { let link = document.createElement('a'); link.download = 'qrcode.png'; link.href = document.querySelector('#qrcode canvas').toDataURL() link.click(); }

emmymayo avatar Oct 17 '22 00:10 emmymayo