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