From 4df511025383d5e57180df843bd74fbf7d0a2949 Mon Sep 17 00:00:00 2001 From: seb Date: Wed, 12 Aug 2026 02:44:32 +0200 Subject: [PATCH] feat(artikel): fill results list viewport with FillSpace Wrap the article search results list in FillSpace (from dashgui) so it becomes a scrollable middle section that fills to the bottom of the viewport. The pagination box is referenced via paginationRef as the anchor above the spacer; measureElement is temporarily a debug unit to visualize the repeating fill. --- src/pages/artikel/index.jsx | 119 +++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 49 deletions(-) diff --git a/src/pages/artikel/index.jsx b/src/pages/artikel/index.jsx index 32d7a4c..db41804 100644 --- a/src/pages/artikel/index.jsx +++ b/src/pages/artikel/index.jsx @@ -1,4 +1,5 @@ -import { Component } from 'react'; +import { Component, createRef } from 'react'; +import FillSpace from 'dashgui/FillSpace'; import Box from '@mui/material/Box'; import InputAdornment from '@mui/material/InputAdornment'; import List from '@mui/material/List'; @@ -85,6 +86,7 @@ class ArtikelSearchPage extends Component { state = initialSearchState(this.props.searchParams); listSlotRef = { current: null }; rowMeasureRef = { current: null }; + paginationRef = createRef(); setListSlotRef = (node) => { if (this.listSlotRef.current === node) return; @@ -368,7 +370,7 @@ class ArtikelSearchPage extends Component { )} {/* Always mount real pagination height (invisible until needed) so pageSize is correct. */} - + - - {rows.length > 0 && ( - - {rows.map((row, index) => ( - e.preventDefault()} - onClick={() => { - this.persistQuery(); - this.props.navigate(artikelDetailPath(row)); - }} - sx={resultRowSx} - > - - {row.sku} - {' · '} - Bestand {formatStock(row.stock)} - {' · '} - Verfügbar {formatStock(row.available)} - {row.categories - ? ` · ${formatCategoryList(row.categories, categoryFacets ?? {})}` - : ''} - - } - slotProps={{ primary: { fontWeight: 500, noWrap: true } }} - /> - + Einheit + + } + > + + {rows.length > 0 && ( + + {rows.map((row, index) => ( + e.preventDefault()} + onClick={() => { + this.persistQuery(); + this.props.navigate(artikelDetailPath(row)); + }} + sx={resultRowSx} > - {row.price != null ? formatPrice(row.price) : '—'} - - - ))} - - )} - + + {row.sku} + {' · '} + Bestand {formatStock(row.stock)} + {' · '} + Verfügbar {formatStock(row.available)} + {row.categories + ? ` · ${formatCategoryList(row.categories, categoryFacets ?? {})}` + : ''} + + } + slotProps={{ primary: { fontWeight: 500, noWrap: true } }} + /> + + {row.price != null ? formatPrice(row.price) : '—'} + + + ))} + + )} + + )}