Skip to content

Commit

Permalink
add nonconsecutive sticky column back in
Browse files Browse the repository at this point in the history
  • Loading branch information
MMFane committed Sep 1, 2023
1 parent 9ec312e commit ff2bf71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/TableModule/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const configSticky = configBasic.map((item, index) => {
});

// double the items in configSticky so it is wide enough to scroll horizontally on most screens, so the sticky columns can be easily demoed
configSticky.forEach((_item) => {
configSticky.forEach((_item, index) => {
configSticky.push({
header: {
label: 'Lorem Ipsum',
Expand All @@ -74,11 +74,12 @@ configSticky.forEach((_item) => {
return dataValue.misc;
},
},
isSticky: false,
// index is arbitrary here, just trying to show sticky columns don't have to be consecutive
isSticky: index === 0 ? true : false,
});
});

const configWrapped = configBasic.map((item, index) => {
const configWrapped = configBasic.map((item) => {
if (item.header.label === 'Calories') {
return {
...item,
Expand Down

0 comments on commit ff2bf71

Please sign in to comment.