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);
|
const colWidths = columnWidths?.slice(0, columnCount);
|
||||||
|
|
||||||
if (colWidths && bodyHeight) {
|
if (colWidths && bodyHeight) {
|
||||||
const bodyColgroup = (
|
const colgroup = (
|
||||||
<colgroup>
|
<colgroup>
|
||||||
{colWidths.map((w, i) => (
|
{colWidths.map((w, i) => (
|
||||||
// eslint-disable-next-line react/no-array-index-key
|
// eslint-disable-next-line react/no-array-index-key
|
||||||
|
@ -246,23 +246,6 @@ function StickyWrap({
|
||||||
</colgroup>
|
</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 = (
|
headerTable = (
|
||||||
<div
|
<div
|
||||||
key="header"
|
key="header"
|
||||||
|
@ -274,7 +257,7 @@ function StickyWrap({
|
||||||
{React.cloneElement(
|
{React.cloneElement(
|
||||||
table,
|
table,
|
||||||
mergeStyleProp(table, fixedTableLayout),
|
mergeStyleProp(table, fixedTableLayout),
|
||||||
headerColgroup,
|
colgroup,
|
||||||
thead,
|
thead,
|
||||||
)}
|
)}
|
||||||
{headerTable}
|
{headerTable}
|
||||||
|
@ -292,7 +275,7 @@ function StickyWrap({
|
||||||
{React.cloneElement(
|
{React.cloneElement(
|
||||||
table,
|
table,
|
||||||
mergeStyleProp(table, fixedTableLayout),
|
mergeStyleProp(table, fixedTableLayout),
|
||||||
headerColgroup,
|
colgroup,
|
||||||
tfoot,
|
tfoot,
|
||||||
)}
|
)}
|
||||||
{footerTable}
|
{footerTable}
|
||||||
|
@ -320,7 +303,7 @@ function StickyWrap({
|
||||||
{React.cloneElement(
|
{React.cloneElement(
|
||||||
table,
|
table,
|
||||||
mergeStyleProp(table, fixedTableLayout),
|
mergeStyleProp(table, fixedTableLayout),
|
||||||
bodyColgroup,
|
colgroup,
|
||||||
tbody,
|
tbody,
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue