@@ -272,7 +272,7 @@ export class Html5QrcodeScanner {
272
272
if ( ! container ) {
273
273
throw `HTML Element with id=${ this . elementId } not found` ;
274
274
}
275
- container . innerHTML = "" ;
275
+ container . textContent = "" ;
276
276
this . createBasicLayout ( container ! ) ;
277
277
this . html5Qrcode = new Html5Qrcode (
278
278
this . getScanRegionId ( ) ,
@@ -336,7 +336,7 @@ export class Html5QrcodeScanner {
336
336
const emptyHtmlContainer = ( ) => {
337
337
const mainContainer = document . getElementById ( this . elementId ) ;
338
338
if ( mainContainer ) {
339
- mainContainer . innerHTML = "" ;
339
+ mainContainer . textContent = "" ;
340
340
this . resetBasicLayout ( mainContainer ) ;
341
341
}
342
342
}
@@ -1047,15 +1047,15 @@ export class Html5QrcodeScanner {
1047
1047
this . getScanRegionId ( ) ) ! ;
1048
1048
1049
1049
if ( this . cameraScanImage ) {
1050
- qrCodeScanRegion . innerHTML = "<br>" ;
1051
- qrCodeScanRegion . appendChild ( this . cameraScanImage ) ;
1050
+ const br = document . createElement ( "br" ) ;
1051
+ qrCodeScanRegion . replaceChildren ( br , this . cameraScanImage ) ;
1052
1052
return ;
1053
1053
}
1054
1054
1055
1055
this . cameraScanImage = new Image ;
1056
1056
this . cameraScanImage . onload = ( _ ) => {
1057
- qrCodeScanRegion . innerHTML = "<br>" ;
1058
- qrCodeScanRegion . appendChild ( $this . cameraScanImage ! ) ;
1057
+ const br = document . createElement ( "br" ) ;
1058
+ qrCodeScanRegion . replaceChildren ( br , $this . cameraScanImage ! ) ;
1059
1059
}
1060
1060
this . cameraScanImage . width = 64 ;
1061
1061
this . cameraScanImage . style . opacity = "0.8" ;
@@ -1069,15 +1069,15 @@ export class Html5QrcodeScanner {
1069
1069
this . getScanRegionId ( ) ) ! ;
1070
1070
1071
1071
if ( this . fileScanImage ) {
1072
- qrCodeScanRegion . innerHTML = "<br>" ;
1073
- qrCodeScanRegion . appendChild ( this . fileScanImage ) ;
1072
+ const br = document . createElement ( "br" ) ;
1073
+ qrCodeScanRegion . replaceChildren ( br , this . fileScanImage ) ;
1074
1074
return ;
1075
1075
}
1076
1076
1077
1077
this . fileScanImage = new Image ;
1078
1078
this . fileScanImage . onload = ( _ ) => {
1079
- qrCodeScanRegion . innerHTML = "<br>" ;
1080
- qrCodeScanRegion . appendChild ( $this . fileScanImage ! ) ;
1079
+ const br = document . createElement ( "br" ) ;
1080
+ qrCodeScanRegion . replaceChildren ( br , $this . fileScanImage ! ) ;
1081
1081
}
1082
1082
this . fileScanImage . width = 64 ;
1083
1083
this . fileScanImage . style . opacity = "0.8" ;
@@ -1088,7 +1088,7 @@ export class Html5QrcodeScanner {
1088
1088
private clearScanRegion ( ) {
1089
1089
const qrCodeScanRegion = document . getElementById (
1090
1090
this . getScanRegionId ( ) ) ! ;
1091
- qrCodeScanRegion . innerHTML = "" ;
1091
+ qrCodeScanRegion . textContent = "" ;
1092
1092
}
1093
1093
1094
1094
//#region state getters
0 commit comments