Skip to content

Fix selection and overflow when zero rows#216

Merged
platypii merged 2 commits intomasterfrom
fix-zero-rows
Jun 25, 2025
Merged

Fix selection and overflow when zero rows#216
platypii merged 2 commits intomasterfrom
fix-zero-rows

Conversation

@platypii
Copy link
Copy Markdown
Contributor

Fixes two bugs that occur when numRows = 0.

  1. nbsp turns into ellipses because the row number column gets too narrow
  2. a bug in selection that would cause error if you tried to "select all" on an empty dataframe
simplescreenrecorder-2025-06-24_23.15.57.mp4

A separate question is why does it get so narrow? The css for the row numbers should have min-width:48px but I think it gets overridden by the column sizing. @severo

@platypii platypii requested a review from severo June 25, 2025 06:21
Copy link
Copy Markdown
Contributor

@severo severo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix for this corner case.

I added a unit test + improved a bit the CSS in #217 (against this branch). Feel free to merge if it works for you

ariaRowIndex={1}
ref={tableCornerRef}
>&nbsp;</TableCorner>
/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea

* add a unit test

* add a story with an empty dataframe

* row labels column defaults to 36px width if empty

* add a story
@platypii platypii merged commit ea91d44 into master Jun 25, 2025
10 checks passed
@platypii platypii deleted the fix-zero-rows branch June 25, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants