Commit 5d4ebcaf50 for handsontable.com
commit 5d4ebcaf50b904e1c50edd9b9b44033dc431b8db
Author: Szymon Dolnik <42141039+Haxikowy@users.noreply.github.com>
Date: Wed Nov 25 14:14:59 2026 +0100
DEV-4216: Skip the scrollbar proxy color when the engine has no scrollbar-color (#14464)
Safari 18 (WebKit 18.2) returns undefined for the computed scrollbarColor.
The proxy passed it to resolveProxyScrollbarColor(), which read .length and
threw inside the draw, so every grid with a header or frozen band next to a
scrolling edge was destroyed on init.
(cherry picked from commit 1d921284133fafd72a99f511e5e78b09444f5ab6)
diff --git a/handsontable/src/3rdparty/walkontable/AGENTS.md b/handsontable/src/3rdparty/walkontable/AGENTS.md
index d935c7400a..8483914b6b 100644
--- a/handsontable/src/3rdparty/walkontable/AGENTS.md
+++ b/handsontable/src/3rdparty/walkontable/AGENTS.md
@@ -1888,6 +1888,13 @@ The proxies carry `tabindex="-1"` (an empty scroll container is a tab stop in Ch
added element `aria-hidden="true"`: the holder's own scroll range and the keyboard already cover what
they do.
+Safari 18 (WebKit 18.2, the Safari and iOS floor in `browser-targets.js`) has no `scrollbar-color`:
+`getComputedStyle(holder).scrollbarColor` is `undefined` there. The proxy copies the color only when the
+engine returns a string, so the proxy keeps the default color on such an engine. Do not pass the computed
+value to `resolveProxyScrollbarColor()` without that check: it reads `.length`, and the throw inside the
+draw destroyed every grid with a header or a frozen band next to a scrolling edge. CI's WebKit supports
+the property, so only the unit test (a computed style without `scrollbarColor`) catches it.
+
Testing traps:
- **Playwright launches Chromium with `--hide-scrollbars`**, which makes every gutter 0, so no proxy is
diff --git a/handsontable/src/3rdparty/walkontable/src/overlay/scrollbarProxies.ts b/handsontable/src/3rdparty/walkontable/src/overlay/scrollbarProxies.ts
index d04ed352c5..c3464da0eb 100644
--- a/handsontable/src/3rdparty/walkontable/src/overlay/scrollbarProxies.ts
+++ b/handsontable/src/3rdparty/walkontable/src/overlay/scrollbarProxies.ts
@@ -578,7 +578,10 @@ export class ScrollbarProxies {
// color) shapes the proxy too and its bar keeps filling the gutter it sits in. The track is left to
// the proxy's background, like the fillers'.
setStyle(elements.proxy, 'scrollbarWidth', holderStyle.scrollbarWidth);
- setStyle(elements.proxy, 'scrollbarColor', resolveProxyScrollbarColor(holderStyle.scrollbarColor));
+
+ if (typeof holderStyle.scrollbarColor === 'string') {
+ setStyle(elements.proxy, 'scrollbarColor', resolveProxyScrollbarColor(holderStyle.scrollbarColor));
+ }
elements.fillers.forEach((filler, index) => {
const box = layout.fillers[index];
diff --git a/handsontable/src/3rdparty/walkontable/test/unit/overlay/scrollbarProxies.unit.ts b/handsontable/src/3rdparty/walkontable/test/unit/overlay/scrollbarProxies.unit.ts
index 1ae66c1b88..9b25cc0f90 100644
--- a/handsontable/src/3rdparty/walkontable/test/unit/overlay/scrollbarProxies.unit.ts
+++ b/handsontable/src/3rdparty/walkontable/test/unit/overlay/scrollbarProxies.unit.ts
@@ -368,11 +368,12 @@ describe('ScrollbarProxies', () => {
* @param {object} direction The layout direction and where the browser draws the vertical bar.
* @param {boolean} [direction.rtl] Whether the grid runs right to left.
* @param {number} [direction.viewX] The holder's `clientLeft`: 15 when the bar is on the left.
+ * @param {object} [direction.style] Overrides of the holder's computed style.
* @returns {object} The module, the holder, the elements it created, and the geometry read count.
*/
function createProxies(
candidates: Partial<ScrollbarProxyCandidates> = {},
- { rtl = false, viewX = 0 }: { rtl?: boolean, viewX?: number } = {},
+ { rtl = false, viewX = 0, style = {} }: { rtl?: boolean, viewX?: number, style?: object } = {},
) {
const holder = document.createElement('div');
const geometryReads = { count: 0 };
@@ -411,6 +412,7 @@ describe('ScrollbarProxies', () => {
borderTopRightRadius: '4px',
borderBottomRightRadius: '4px',
borderBottomLeftRadius: '4px',
+ ...style,
};
},
},
@@ -521,6 +523,15 @@ describe('ScrollbarProxies', () => {
expect(colors).toEqual(['rgb(163, 163, 163) transparent', 'rgb(163, 163, 163) transparent']);
});
+ it('should leave the proxy\'s scrollbar color unset when the engine has no scrollbar-color', () => {
+ createProxies({}, { style: { scrollbarColor: undefined } });
+
+ const proxies = Array.from(parent.querySelectorAll<HTMLElement>('.htScrollbarProxy'));
+
+ expect(proxies.length).toBe(2);
+ expect(proxies.map(proxy => proxy.style.scrollbarColor || '')).toEqual(['', '']);
+ });
+
it('should place the proxies and the frame on the left gutter of an RTL holder', () => {
createProxies({}, { rtl: true, viewX: 15 });