From 669d34a8c8f1d8ff6cae3857a0705473a5fffcbe Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 28 Feb 2022 13:48:35 +0100 Subject: [PATCH] Fix scrollbar compensation. --- .../app/framework/angular/compensate-scrollbar.directive.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/framework/angular/compensate-scrollbar.directive.ts b/frontend/src/app/framework/angular/compensate-scrollbar.directive.ts index 862aa5bcc..c6c3b2b13 100644 --- a/frontend/src/app/framework/angular/compensate-scrollbar.directive.ts +++ b/frontend/src/app/framework/angular/compensate-scrollbar.directive.ts @@ -47,8 +47,9 @@ export class CompensateScrollbarDirective extends ResourceOwner implements Resiz const element = this.element.nativeElement; - const scrollWidth = element.clientWidth; - const scollbarWidth = element.offsetWidth - scrollWidth; + const clientWidth = element.clientWidth; + const scrollWidth = element.scrollWidth; + const scollbarWidth = clientWidth === scrollWidth ? element.offsetWidth - clientWidth : 0; if (this.previousScrollbarWidth == scollbarWidth) { return;