mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix: Table chart types headers are offset from the columns in the table (#36190)
Co-authored-by: Diego Pucci <diegopucci.me@gmail.com>
This commit is contained in:
@@ -166,7 +166,7 @@ function StickyWrap({
|
||||
const scrollBodyRef = useRef<HTMLDivElement>(null); // main body
|
||||
|
||||
const scrollBarSize = getScrollBarSize();
|
||||
const { bodyHeight, columnWidths } = sticky;
|
||||
const { bodyHeight, columnWidths, hasVerticalScroll } = sticky;
|
||||
const needSizer =
|
||||
!columnWidths ||
|
||||
sticky.width !== maxWidth ||
|
||||
@@ -283,13 +283,18 @@ function StickyWrap({
|
||||
</colgroup>
|
||||
);
|
||||
|
||||
const headerContainerWidth = hasVerticalScroll
|
||||
? maxWidth - scrollBarSize
|
||||
: maxWidth;
|
||||
|
||||
headerTable = (
|
||||
<div
|
||||
key="header"
|
||||
ref={scrollHeaderRef}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
scrollbarGutter: 'stable',
|
||||
width: headerContainerWidth,
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
role="presentation"
|
||||
>
|
||||
@@ -309,7 +314,8 @@ function StickyWrap({
|
||||
ref={scrollFooterRef}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
scrollbarGutter: 'stable',
|
||||
width: headerContainerWidth,
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
role="presentation"
|
||||
>
|
||||
@@ -339,6 +345,8 @@ function StickyWrap({
|
||||
height: bodyHeight,
|
||||
overflow: 'auto',
|
||||
scrollbarGutter: 'stable',
|
||||
width: maxWidth,
|
||||
boxSizing: 'border-box',
|
||||
}}
|
||||
css={scrollBarStyles}
|
||||
onScroll={sticky.hasHorizontalScroll ? onScroll : undefined}
|
||||
|
||||
Reference in New Issue
Block a user