From 1a83b746b5095aed9b1baddf0d93dec94e829555 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 28 May 2024 14:41:21 +0100 Subject: [PATCH] Ensure grid autoscroll for selected cell visibility accounts for button column width --- packages/frontend-core/src/components/grid/stores/scroll.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/stores/scroll.js b/packages/frontend-core/src/components/grid/stores/scroll.js index b071c1fc38..e7114cd00c 100644 --- a/packages/frontend-core/src/components/grid/stores/scroll.js +++ b/packages/frontend-core/src/components/grid/stores/scroll.js @@ -109,6 +109,7 @@ export const initialise = context => { maxScrollTop, scrollLeft, maxScrollLeft, + buttonColumnWidth, } = context // Ensure scroll state never goes invalid, which can happen when changing @@ -194,8 +195,10 @@ export const initialise = context => { // Ensure column is not cutoff on right edge else { + const $buttonColumnWidth = get(buttonColumnWidth) const rightEdge = column.left + column.width - const rightBound = $bounds.width + $scroll.left - FocusedCellMinOffset + const rightBound = + $bounds.width + $scroll.left - FocusedCellMinOffset - $buttonColumnWidth delta = rightEdge - rightBound if (delta > 0) { scroll.update(state => ({