mirror of https://github.com/apache/superset.git
fix(chart-table): Scrollbar causing header + footer overflow (#21064)
This commit is contained in:
parent
89bb6c024b
commit
2679ee2e46
|
@ -237,7 +237,7 @@ function StickyWrap({
|
|||
const colWidths = columnWidths?.slice(0, columnCount);
|
||||
|
||||
if (colWidths && bodyHeight) {
|
||||
const bodyColgroup = (
|
||||
const colgroup = (
|
||||
<colgroup>
|
||||
{colWidths.map((w, i) => (
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
|
@ -246,23 +246,6 @@ function StickyWrap({
|
|||
</colgroup>
|
||||
);
|
||||
|
||||
// header columns do not have vertical scroll bars,
|
||||
// so we add scroll bar size to the last column
|
||||
const headerColgroup =
|
||||
sticky.hasVerticalScroll && scrollBarSize ? (
|
||||
<colgroup>
|
||||
{colWidths.map((x, i) => (
|
||||
// eslint-disable-next-line react/no-array-index-key
|
||||
<col
|
||||
key={i}
|
||||
width={x + (i === colWidths.length - 1 ? scrollBarSize : 0)}
|
||||
/>
|
||||
))}
|
||||
</colgroup>
|
||||
) : (
|
||||
bodyColgroup
|
||||
);
|
||||
|
||||
headerTable = (
|
||||
<div
|
||||
key="header"
|
||||
|
@ -274,7 +257,7 @@ function StickyWrap({
|
|||
{React.cloneElement(
|
||||
table,
|
||||
mergeStyleProp(table, fixedTableLayout),
|
||||
headerColgroup,
|
||||
colgroup,
|
||||
thead,
|
||||
)}
|
||||
{headerTable}
|
||||
|
@ -292,7 +275,7 @@ function StickyWrap({
|
|||
{React.cloneElement(
|
||||
table,
|
||||
mergeStyleProp(table, fixedTableLayout),
|
||||
headerColgroup,
|
||||
colgroup,
|
||||
tfoot,
|
||||
)}
|
||||
{footerTable}
|
||||
|
@ -320,7 +303,7 @@ function StickyWrap({
|
|||
{React.cloneElement(
|
||||
table,
|
||||
mergeStyleProp(table, fixedTableLayout),
|
||||
bodyColgroup,
|
||||
colgroup,
|
||||
tbody,
|
||||
)}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue