Skip to content

Commit

Permalink
fix(Table): table sticky column z-index (#2331)
Browse files Browse the repository at this point in the history
* fix: table sticky column z-index

* Create cyan-drinks-poke.md

* fix: snapshots
  • Loading branch information
saurabhdaware committed Aug 22, 2024
1 parent 0a5d0b4 commit 830c874
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 109 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-drinks-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@razorpay/blade": patch
---

fix(Table): table sticky column overlapping with relative cell
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
Loading

0 comments on commit 830c874

Please sign in to comment.