Skip to content

Commit

Permalink
fix: table sticky column z-index
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabhdaware committed Aug 19, 2024
1 parent 69155cf commit 4df1a64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions packages/blade/src/components/Table/Table.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { TableContext } from './TableContext';
import { ComponentIds } from './componentIds';
import {
checkboxCellWidth,
firstColumnStickyHeaderFooterZIndex,
firstColumnStickyZIndex,
refreshWrapperZIndex,
tableBackgroundColor,
tablePagination,
Expand Down Expand Up @@ -169,14 +169,14 @@ const _Table = <Item,>({
&:nth-of-type(1) {
left: 0 !important;
position: sticky !important;
z-index: ${firstColumnStickyHeaderFooterZIndex} !important;
z-index: ${firstColumnStickyZIndex} !important;
}
${
selectionType === 'multiple' &&
`&:nth-of-type(2) {
left: ${checkboxCellWidth}px !important;
position: sticky !important;
z-index: ${firstColumnStickyHeaderFooterZIndex} !important;
z-index: ${firstColumnStickyZIndex} !important;
}
`
}`
Expand All @@ -186,14 +186,14 @@ const _Table = <Item,>({
&:nth-of-type(1) {
left: 0 !important;
position: sticky !important;
z-index: ${firstColumnStickyHeaderFooterZIndex} !important;
z-index: ${firstColumnStickyZIndex} !important;
}
${
selectionType === 'multiple' &&
`&:nth-of-type(2) {
left: ${checkboxCellWidth}px !important;
position: sticky !important;
z-index: ${firstColumnStickyHeaderFooterZIndex} !important;
z-index: ${firstColumnStickyZIndex} !important;
}
`
}`
Expand All @@ -203,12 +203,14 @@ const _Table = <Item,>({
&:nth-of-type(1) {
left: 0 !important;
position: sticky !important;
z-index: ${firstColumnStickyZIndex} !important;
}
${
selectionType === 'multiple' &&
`&:nth-of-type(2) {
left: ${checkboxCellWidth}px !important;
position: sticky !important;
z-index: ${firstColumnStickyZIndex} !important;
}
`
}`
Expand All @@ -230,6 +232,7 @@ const _Table = <Item,>({
`,
HeaderCell: `
position: ${shouldHeaderBeSticky ? 'sticky' : 'relative'};
top: ${shouldHeaderBeSticky ? '0' : undefined};
${firstColumnStickyHeaderCellCSS}
`,
Expand Down
4 changes: 2 additions & 2 deletions packages/blade/src/components/Table/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AlertCircleIcon, CheckIcon } from '~components/Icons';
import { size } from '~tokens/global';

const firstColumnStickyHeaderFooterZIndex = 2;
const firstColumnStickyZIndex = 2;

const refreshWrapperZIndex = 3;

Expand Down Expand Up @@ -145,7 +145,7 @@ export {
tablePagination,
refreshWrapperZIndex,
tableBackgroundColor,
firstColumnStickyHeaderFooterZIndex,
firstColumnStickyZIndex,
checkboxCellWidth,
tableEditableCellRowDensityToInputSizeMap,
validationStateToInputTrailingIconMap,
Expand Down

0 comments on commit 4df1a64

Please sign in to comment.