append download link to DOM before downloading

main
briandennis 7 years ago committed by Brian Dennis
parent c184598fd1
commit 0004f25fea

@ -83,7 +83,9 @@ class Editor extends React.Component {
const link = document.createElement('a') const link = document.createElement('a')
link.download = 'carbon.png' link.download = 'carbon.png'
link.href = dataUrl link.href = dataUrl
document.body.appendChild(link)
link.click() link.click()
link.remove()
}) })
} }

Loading…
Cancel
Save