mirror of
https://github.com/apache/superset.git
synced 2026-09-09 08:44:32 +00:00
fix(plugin-chart-table): clarify load-bearing vs secondary fix, remove any casts in sticky test
Some comments (useSticky.tsx, useSticky.test.tsx, RCA.md) still framed the scrollbar-gutter/scrollBarStyles matching as the mechanism that prevents the reported clipping, contradicting this branch's own hit-testing conclusion that it's the unconditional width: maxWidth change that's load-bearing, with gutter/style matching kept only as an unverified, secondary consistency measure for combined horizontal+vertical scrolling. Rewrite those comments and RCA sections to say so explicitly, and fix a getScrollBarSize.test.ts comment that still described the removed maxWidth - scrollBarSize subtraction as the header's "shrink amount". Also remove the `as any` casts from the sticky regression test: type `columns` as `Column<Row>[]` and pass `useSticky` directly, letting `headerGroups`/`rows`/`cells` infer their existing react-table types (already declared in `src/DataTable/types/react-table.d.ts`) instead of bypassing type-checking of the exercised contract. Refs #21063
This commit is contained in:
+3
-3
@@ -45,8 +45,8 @@ test('getCustomScrollBarSize measures the probe using the shared custom scrollba
|
||||
});
|
||||
|
||||
test('CUSTOM_SCROLLBAR_SIZE matches the custom scrollbar width rendered in the sticky table', () => {
|
||||
// useSticky.tsx's scrollBarStyles must stay in sync with this constant so
|
||||
// the sticky header's shrink amount always matches the body's real
|
||||
// scrollbar width.
|
||||
// useSticky.tsx's scrollBarStyles sets `::-webkit-scrollbar { width: ... }`
|
||||
// from this constant, so it must stay in sync with it or the real
|
||||
// scrollbar body/sizer render won't match what this constant claims.
|
||||
expect(CUSTOM_SCROLLBAR_SIZE).toBe(8);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user