buildo / bento-design-system

A customizable and extensible Design System framework for React.js projects
https://www.bento-ds.com
MIT License
116 stars 12 forks source link

Search lastStickyColumnIndex by column id if set; search headers only inside tableContainer #827

Closed federico-ercoles closed 8 months ago

federico-ercoles commented 8 months ago

Currently, Table component assumes that columns will not contain an id and that accessor will be used as default for the id in headerGroups. However, if columns contain an id that is different from the accessor, this will break the identification of the last sticky column to apply the padding. This PR fixes that by searching the last sticky column by id first, and defaulting to accessor if not defined.

Also, this PR updates the element search for the headers to compute the style for the sticky columns to search only inside the tableContainer element, instead of the whole page, to avoid conflicts with other tables in the same page.