nick-keller / react-datasheet-grid

An Airtable-like / Excel-like component to create beautiful spreadsheets.
MIT License
1.81k stars 170 forks source link

Add stickyFirstColumn prop #327

Open vinicoder opened 10 months ago

vinicoder commented 10 months ago

PR to introduce a new feature where the first column can be sticky.

 <DataSheetGrid
    value={data}
    onChange={setData}
    columns={columns}
    stickyFirstColumn //  Use this to make the first column sticky
 />

https://github.com/nick-keller/react-datasheet-grid/assets/3522573/2e80807c-da68-45f6-a699-e8f2c06673c7

netlify[bot] commented 10 months ago

Deploy Preview for react-datasheet-grid canceled.

Name Link
Latest commit b402e9afc016f8a7c8b0f30f0a19670eb8b7d13c
Latest deploy log https://app.netlify.com/sites/react-datasheet-grid/deploys/657fb670fc5e3d0008b109ab
nick-keller commented 9 months ago

From what I can see on your video, the selection rectangle behaves strangely. This is a complexe task that might need a deep re-work

vinicoder commented 9 months ago

From what I can see on your video, the selection rectangle behaves strangely. This is a complexe task that might need a deep re-work

The only issue I see is that the selection rectangle is floating, so it doesn't behave as well as it should with the sticky column. I didn't want to invest much more time in this because first I wanted to know what you think about it, being the project's creator. If you can, test this branch to see how it is; the video can be misleading.

We are using your lib in our project; this is the only missing feature. Do you mind if I create a new NPM package with this PR? We have already tested it, and it will work for our needs.

Sankarmukesh commented 9 months ago

Hi @nick-keller can we have sticky left option for first 2 columns

Sankarmukesh commented 9 months ago

@nick-keller @vinicoder can we stop rerendering when datasheetgrid is scrolling is that possible?