From 2c26e895763fecd9c5a312c223a4c26a299525c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20L=C3=A4ngler?= Date: Fri, 8 May 2026 22:48:42 +0200 Subject: [PATCH] Fix off-by-one in pgResponsive when any is hidden introduced in #1940 --- resources/js/components/pgResponsive/onResize.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/components/pgResponsive/onResize.js b/resources/js/components/pgResponsive/onResize.js index 96ff8f23..a24330ec 100644 --- a/resources/js/components/pgResponsive/onResize.js +++ b/resources/js/components/pgResponsive/onResize.js @@ -47,7 +47,7 @@ function getItemsToHide(element, tableWidth) { if (fitsMoreItems && calc <= tableWidth && (calc + itemWidth <= tableWidth)) { calc += itemWidth; } else { - itemsToHide.push(visibleThs.indexOf(item) + 1) + itemsToHide.push(items.indexOf(item) + 1) fitsMoreItems = false } }) @@ -79,7 +79,7 @@ function fillTableExpand(element, hideItems) { if (!expandContainer) continue - let rowName = element.querySelector(`table thead tr th:nth-child(${hideItem}) span[data-value]`).textContent + let rowName = element.querySelector(`table thead tr th:nth-child(${hideItem}) span[data-value]`).textContent ?? '' const rowValue = row.querySelector(`tr:last-child td:nth-child(${hideItem})`)?.innerHTML