Skip to content

Commit 2959304

Browse files
fix(style): limit filter container height and make it scrollable (#1903)
1 parent 06d2a3f commit 2959304

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

elements/itemfilter/src/main.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,14 @@ export class EOxItemFilter extends LitElement {
480480
${when(
481481
this.filterProperties,
482482
() => html`
483-
<div style="display: var(--filter-display);">
483+
<div
484+
style="display: var(--filter-display); min-height: ${this
485+
.inlineMode
486+
? "100%"
487+
: this.filterProperties.length > 2
488+
? "50%"
489+
: this.filterProperties.length * 32 + 105 + "px"}"
490+
>
484491
<eox-itemfilter-container
485492
.filters=${this.filters}
486493
.filterProperties=${this.filterProperties}
@@ -537,7 +544,7 @@ export class EOxItemFilter extends LitElement {
537544
</nav>
538545
`,
539546
)}
540-
<div class="scroll" style="flex: 1;">
547+
<div class="scroll" style="flex: 1; max-height: 100%">
541548
<ul id="filters" class="list no-space">
542549
${map(
543550
Object.values(this.filters),

elements/itemfilter/src/style.eox.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ eox-itemfilter-container {
5656
flex-grow: 0;
5757
flex-shrink: 0;
5858
overflow: hidden;
59+
height: 100%;
5960
}
6061
eox-itemfilter-results {
6162
flex-grow: 1;
@@ -299,21 +300,27 @@ button.icon {
299300
}
300301
-container-results::-webkit-scrollbar,
301302
.inline-container::-webkit-scrollbar,
302-
.inline-content::-webkit-scrollbar {
303+
.inline-content::-webkit-scrollbar,
304+
form#itemfilter > div::-webkit-scrollbar {
303305
inline-size: 0.4rem;
304306
block-size: 0.4rem;
305307
}
306308
-container-results::-webkit-scrollbar-thumb,
307309
.inline-container::-webkit-scrollbar-thumb,
308-
.inline-content::-webkit-scrollbar-thumb {
310+
.inline-content::-webkit-scrollbar-thumb,
311+
form#itemfilter > div::-webkit-scrollbar-thumb {
309312
background: lightgrey;
310313
border-radius: 1rem;
311314
cursor: default;
312315
}
313316
.inline-container:is(:hover,:focus)::-webkit-scrollbar-thumb,
314-
.inline-content:is(:hover,:focus)::-webkit-scrollbar-thumb {
317+
.inline-content:is(:hover,:focus)::-webkit-scrollbar-thumb,
318+
form#itemfilter > div:is(:hover,:focus)::-webkit-scrollbar-thumb {
315319
background: var(--outline);
316320
}
321+
form#itemfilter > div::-webkit-scrollbar-thumb {
322+
background: transparent;
323+
}
317324
.hidden {
318325
height: 0;
319326
padding: 0;

0 commit comments

Comments
 (0)