From 1b73b4a0b6935e68233bfcce9ca2c1515e3da570 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 c9ce13ab..2f3d34a7 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;
@@ -1956,32 +1956,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