From b6349468230377eabbe31877f751167413ad01a7 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 15 Aug 2016 19:12:46 +0300 Subject: Switch to img based code --- index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 82d7973..306a819 100644 --- a/index.js +++ b/index.js @@ -20,16 +20,14 @@ class Qrgen extends React.Component { value: this.state.text, size: this.state.size }) + this.refs.qrimg.src = this.qr.toDataURL() } + componentDidUpdate (prevProps, prevState) { this.qr.value = this.state.text this.qr.size = this.state.size - } - - saveImage () { - this.refs.dl.download = 'qrgen-test.png' - this.refs.dl.href = this.qr.toDataURL() + this.refs.qrimg.src = this.qr.toDataURL() } render () { @@ -41,8 +39,9 @@ class Qrgen extends React.Component { { this.setState(Object.assign({}, this.state, { size: e.target.value })) }}> - { this.saveImage() }}>Save QR Code +

To save the QR code, right-click the image and 'Save Image As', or touch and hold the image on your mobile browser.

+ -- cgit v1.3.1