Enforce the minimum height of filtered checkbox lists dynamically
authorAlexander Ebert <ebert@woltlab.com>
Mon, 6 Feb 2023 13:25:16 +0000 (14:25 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 6 Feb 2023 13:25:16 +0000 (14:25 +0100)
See https://www.woltlab.com/community/thread/298850-mulitselect-felder-werden-gr%C3%B6%C3%9Fer-angezeigt-als-notwendig-nach-update-auf-5-5/

ts/WoltLabSuite/Core/Ui/ItemList/Filter.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Filter.js
wcfsetup/install/files/style/ui/scrollableCheckboxList.scss

index 98a42eda321cdd781a38b7766377a0234f4568be..458e47d27750c180b67d5cc8b0cc7fd90c868b9c 100644 (file)
@@ -129,7 +129,8 @@ class UiItemListFilter {
     this._input = input;
 
     // set fixed height to avoid layout jumps
-    this._element.style.setProperty("height", `${this._element.offsetHeight}px`, "");
+    const fixedHeight = Math.max(this._element.offsetHeight, 200);
+    this._element.style.setProperty("height", `${fixedHeight}px`, "");
   }
 
   /**
index c29f821e71d1b17af33bdea0e988c769adc017c6..be878c380fe8ad0f42d440ddc24fcb3499cf2e5d 100644 (file)
@@ -93,7 +93,8 @@ define(["require", "exports", "tslib", "../../Core", "../../Dom/Util", "../../La
             this._element = element;
             this._input = input;
             // set fixed height to avoid layout jumps
-            this._element.style.setProperty("height", `${this._element.offsetHeight}px`, "");
+            const fixedHeight = Math.max(this._element.offsetHeight, 200);
+            this._element.style.setProperty("height", `${fixedHeight}px`, "");
         }
         /**
          * Resets the filter.
index 0c0dc10e4d520dc3be2a715680bd0103f7ae5bb9..4f7bc12b564f1a20efe16630a66c2a9fbda81bfe 100644 (file)
@@ -4,7 +4,6 @@
        color: $wcfInputText;
        max-height: 500px;
        max-width: 500px;
-       min-height: 200px;
        overflow: auto;
        padding: 5px;