Skip to content

Commit

Permalink
Calling Html5QrcodeScanner#clear() will clear the entire UI
Browse files Browse the repository at this point in the history
Calling `Html5QrcodeScanner#clear()` will also clear the UI rendered due to image based scan. This should address [issue#193](#193)
  • Loading branch information
mebjas committed Dec 20, 2021
1 parent bef29cf commit 29a08f6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ class Html5QrcodeScanner {
*/
getState(): Html5QrcodeScannerState;

/** Removes the QR Code scanner. */
/** Removes the QR Code scanner UI. */
clear(): Promise<void> {}
}
```
Expand Down
11 changes: 3 additions & 8 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
### Version 2.1.5

- Changed behavior from throwing error in case `qrbox.width` or `qrbox` is larger
than the width of the root element. In such cases the dimension will automatically
be truncated to the size of root element and will throw a warning based on verbosity
settings. This should address [issue#357](https://github.com/mebjas/html5-qrcode/issues/357)
- If `qrbox` is not set in config for either `Html5QrcodeScanner` or `Html5Qrcode`
the scanning box will default to the size of video stream. From UI perspective
there will be no shaded QR scanning box visible to user. This should resolve
[Issue#343](https://github.com/mebjas/html5-qrcode/issues/343)
- Changed behavior from throwing error in case `qrbox.width` or `qrbox` is larger than the width of the root element. In such cases the dimension will automatically be truncated to the size of root element and will throw a warning based on verbosity settings. This should address [issue#357](https://github.com/mebjas/html5-qrcode/issues/357)
- If `qrbox` is not set in config for either `Html5QrcodeScanner` or `Html5Qrcode` the scanning box will default to the size of video stream. From UI perspective there will be no shaded QR scanning box visible to user. This should resolve [Issue#343](https://github.com/mebjas/html5-qrcode/issues/343).
- Calling `Html5QrcodeScanner#clear()` will also clear the UI rendered due to image based scan. This should address [issue#193](https://github.com/mebjas/html5-qrcode/issues/193)

### Version 2.1.4

Expand Down
2 changes: 1 addition & 1 deletion minified/html5-qrcode.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/html5-qrcode-scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ export class Html5QrcodeScanner {
}
reject(error);
});
} else {
// Assuming file based scan was ongoing.
this.html5Qrcode.clear();
emptyHtmlContainer();
}
});
}
Expand Down

0 comments on commit 29a08f6

Please sign in to comment.