Column fixed prop #229
Replies: 1 comment 2 replies
-
Sticky columns are not exactly a breeze to implement, especially in conjunction with other generic Mantine DataTable features, because you don't really know "a priori" their widths, and when you position something with "sticky" you need to offset it relative to its nearest scrolling ancestor and containing block (see this MDN docs page on positioning). In case of sticky columns, we'd need to know each one's "left", and this would be quite difficult (if not impossible) to implement in a generic way that doesn't negatively impact other DataTable features. In the Mantine DataTable component, the cell containing the selection checkbox for each row is sticky, but in that case it's not that difficult to implement because I know it's always the first cell, and therefore I could set its left to 0. Have a look at the source code here to better understand what I mean: https://github.com/icflorescu/mantine-datatable/blob/main/package/DataTableRowSelectorCell.tsx. That being said, I'm completely open to suggestions on how to implement this. Or better yet, a PR would be fantastic! |
Beta Was this translation helpful? Give feedback.
-
I think there should be "fixed" or "fixed position" props in column options, which is pretty good UX for many columns table, wdy think?
Beta Was this translation helpful? Give feedback.
All reactions