Skip to content
Snippets Groups Projects
Commit a9c0b4af authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Add smooth scroll to behavior for QR code scanner

parent 663383f9
No related branches found
No related tags found
No related merge requests found
Pipeline #13404 passed
...@@ -169,6 +169,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { ...@@ -169,6 +169,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
let outputContainer = this._("#output"); let outputContainer = this._("#output");
let outputMessage = this._("#outputMessage"); let outputMessage = this._("#outputMessage");
let outputData = this._("#outputData"); let outputData = this._("#outputData");
let qrContainer = this._("#qr");
let color = this.scanIsOk ? getComputedStyle(this) let color = this.scanIsOk ? getComputedStyle(this)
.getPropertyValue('--dbp-success-bg-color') : getComputedStyle(this) .getPropertyValue('--dbp-success-bg-color') : getComputedStyle(this)
...@@ -201,6 +202,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { ...@@ -201,6 +202,7 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
video.setAttribute("playsinline", true); // required to tell iOS safari we don't want fullscreen video.setAttribute("playsinline", true); // required to tell iOS safari we don't want fullscreen
video.play(); video.play();
that.videoRunning = true; that.videoRunning = true;
qrContainer.scrollIntoView({ behavior: 'smooth', block: 'start' });
requestAnimationFrame(tick); requestAnimationFrame(tick);
}).catch((e) => { console.log(e); that.askPermission = true;}); }).catch((e) => { console.log(e); that.askPermission = true;});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment