evidence icon indicating copy to clipboard operation
evidence copied to clipboard

Add freeze column to datatable

Open hughess opened this issue 2 years ago • 5 comments

Description

Minimal implementation of a freezeColumn prop for DataTable, which freezes the first column on the left and allows you to scroll the other columns.

If rowNumbers are shown, these are not frozen - they will scroll away, leaving only the first column of the table frozen on the left.

CleanShot 2024-01-23 at 15 33 01

Checklist

  • [x] For UI or styling changes, I have added a screenshot or gif showing before & after
  • [x] I have added a changeset

To Do

  • Fix issue with white background in Firefox - overrides the border of the cells
  • Fix issue with edges of white background on mobile - interferes with header bottom border
  • Test on Windows and multiple browsers

hughess avatar Jan 23 '24 20:01 hughess

🦋 Changeset detected

Latest commit: 639d47a42f50821398581e776ef24c793d98e87e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@evidence-dev/core-components Patch
@evidence-dev/components Patch
@evidence-dev/evidence Patch
evidence-test-environment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jan 23 '24 20:01 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2024 5:36pm

vercel[bot] avatar Jan 23 '24 20:01 vercel[bot]

Deploy Preview for evidence-development-workspace ready!

Name Link
Latest commit 639d47a42f50821398581e776ef24c793d98e87e
Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/65b3ed449ecb37000864fd6d
Deploy Preview https://deploy-preview-1515--evidence-development-workspace.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jan 23 '24 20:01 netlify[bot]

Why is the white background needed?

archiewood avatar Feb 01 '24 18:02 archiewood

Why is the white background needed?

when you scroll horizontally, the content from the right columns will pass behind the frozen column - you can see it underneath if you don't set the background

hughess avatar Feb 01 '24 18:02 hughess

Need to revisit this - would be a great feature to have, but it seems like the table needs to be aware of the width of the columns, which will require some thought

hughess avatar Mar 20 '24 22:03 hughess