From 03623666df69328b1e15152c0f3c842e340a192d Mon Sep 17 00:00:00 2001
From: Christina Toegl <toegl@tugraz.at>
Date: Thu, 9 Dec 2021 16:29:32 +0100
Subject: [PATCH] Fix overflow

---
 .../src/nextcloud-file-picker.js              | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/packages/file-handling/src/nextcloud-file-picker.js b/packages/file-handling/src/nextcloud-file-picker.js
index f8b48fef..62e19c23 100644
--- a/packages/file-handling/src/nextcloud-file-picker.js
+++ b/packages/file-handling/src/nextcloud-file-picker.js
@@ -66,7 +66,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
         this.isInRecent = false;
         this.userName = '';
         this.menuHeightBreadcrumb = -1;
-        this.menuHeightAdditional = -1; 
+        this.menuHeightAdditional = -1;
 
         this.boundCloseBreadcrumbMenuHandler = this.hideBreadcrumbMenu.bind(this);
         this.initateOpenBreadcrumbMenu = false;
@@ -1958,32 +1958,23 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
         if (isMenuOverflow && !menu.classList.contains('hidden')) {
             let actualHeight = this._('.wrapper').offsetHeight - this._('.nextcloud-nav').offsetHeight;
             // console.log("actual height: ", actualHeight);
-
             menu.setAttribute('style', 'position: fixed;top: ' + topValue + 'px;height: ' + actualHeight + 'px;max-width: ' + maxWidth + 'px;overflow-y: auto;');
             menu.scrollTop = 0;
+            this._('.nextcloud-content').setAttribute('style', 'overflow:hidden;');
 
-            document.body.setAttribute('style', 'overflow:hidden;'); //TODO replace with correct scrollbar remove
-
-        } else if (isMenuOverflow && menu.classList.contains('hidden')) {
-
-            console.log("isMenuOverflow AND hidden - remove attributes");
-
-            document.body.removeAttribute('style', 'overflow:hidden;'); //TODO replace with correct scrollbar remove
-
+        } else if (isMenuOverflow && menu.classList.contains('hidden')) { //TODO is this case possible?
+            this._('.nextcloud-content').removeAttribute('style', 'overflow:hidden;');
             menu.removeAttribute('style');
-
         }
         // computations for overflow - end
 
         if (!menu.classList.contains('hidden')) { // add event listener for clicking outside of menu
             document.addEventListener('click', this.boundCloseBreadcrumbMenuHandler);
-            console.log('add event listener');
             this.initateOpenBreadcrumbMenu = true;
         }
         else {
             document.removeEventListener('click', this.boundCloseBreadcrumbMenuHandler);
-            console.log('delete event listener');
-
+            this._('.nextcloud-content').removeAttribute('style', 'overflow:hidden;');
             menu.removeAttribute('style');
         }
     }
-- 
GitLab