diff --git a/dojo/static/dojo/css/dojo.css b/dojo/static/dojo/css/dojo.css index 8871ec262be..1a104d7345a 100644 --- a/dojo/static/dojo/css/dojo.css +++ b/dojo/static/dojo/css/dojo.css @@ -1084,8 +1084,9 @@ span.endpoint_product { .filter-form-group > .col-lg-3 { grid-column: span 3; } } -/* Filter category grouping (details/summary) */ +/* Filter category grouping (Alpine-toggled accordion) */ .filter-category { + flex: 0 0 100%; border-bottom: 1px solid var(--color-border, #DCDCDC); } @@ -1097,14 +1098,15 @@ span.endpoint_product { display: flex; align-items: center; justify-content: space-between; + width: 100%; padding: 0.5rem 0.25rem; + background: none; + border: none; + font: inherit; + color: inherit; + text-align: left; cursor: pointer; user-select: none; - list-style: none; -} - -.filter-category-header::-webkit-details-marker { - display: none; } .filter-category-title { @@ -1121,10 +1123,27 @@ span.endpoint_product { transition: transform 0.2s ease; } -.filter-category[open] > .filter-category-header .filter-category-chevron { +.filter-category-chevron.is-open { transform: rotate(180deg); } +/* Slide the whole category open/closed via the grid-rows trick so the header + stack moves together smoothly instead of snapping. Works in all browsers. */ +.filter-category-content { + display: grid; + grid-template-rows: 0fr; + transition: grid-template-rows 0.2s ease; +} + +.filter-category-content.is-open { + grid-template-rows: 1fr; +} + +.filter-category-content > .filter-category-clip { + overflow: hidden; + min-height: 0; +} + .filter-category-body { padding-bottom: 0.75rem; } diff --git a/dojo/templates/dojo/filter_snippet.html b/dojo/templates/dojo/filter_snippet.html index cf92898e58a..84387e4f887 100644 --- a/dojo/templates/dojo/filter_snippet.html +++ b/dojo/templates/dojo/filter_snippet.html @@ -14,31 +14,35 @@ {% endfor %} {% get_filter_groups form as filter_groups %} {% for group in filter_groups %} -
- +
+
-
- {% for field in group.fields %} -
-
- - {% with placeholder="placeholder:"|add:field.label %} - {{ field|addcss:"class: form-control filter-form-control"|addcss:placeholder }} - {% endwith %} -
+ + +
+
+
+ {% for field in group.fields %} +
+
+ + {% with placeholder="placeholder:"|add:field.label %} + {{ field|addcss:"class: form-control filter-form-control"|addcss:placeholder }} + {% endwith %} +
+
+ {% endfor %}
- {% endfor %} +
-
+ {% endfor %}