Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix column resize on header cell using colSpan #2802

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

amanmahajan7
Copy link
Contributor

No description provided.

@amanmahajan7 amanmahajan7 self-assigned this Jan 28, 2022
@codecov
Copy link

codecov bot commented Jan 28, 2022

Codecov Report

Merging #2802 (1dbf5b5) into main (1c03b51) will increase coverage by 1.24%.
The diff coverage is 87.50%.

❗ Current head 1dbf5b5 differs from pull request most recent head 20dc048. Consider uploading reports for the commit 20dc048 to get more accurate results

@@            Coverage Diff             @@
##             main    #2802      +/-   ##
==========================================
+ Coverage   93.05%   94.30%   +1.24%     
==========================================
  Files          40       39       -1     
  Lines        1268     1265       -3     
  Branches      405      406       +1     
==========================================
+ Hits         1180     1193      +13     
+ Misses         88       72      -16     
Impacted Files Coverage Δ
src/HeaderCell.tsx 89.47% <87.50%> (+17.00%) ⬆️
src/Cell.tsx 91.30% <0.00%> (-8.70%) ⬇️
src/Row.tsx 100.00% <0.00%> (ø)
src/Columns.tsx 100.00% <0.00%> (ø)
src/HeaderRow.tsx 100.00% <0.00%> (ø)
src/style/cell.ts 100.00% <0.00%> (ø)
src/style/core.ts 100.00% <0.00%> (ø)
src/SummaryRow.tsx 100.00% <0.00%> (ø)
src/utils/index.ts 88.88% <0.00%> (ø)
src/SummaryCell.tsx 100.00% <0.00%> (ø)
... and 11 more

@amanmahajan7 amanmahajan7 marked this pull request as ready for review September 21, 2022 01:39
src/HeaderCell.tsx Outdated Show resolved Hide resolved
if (colSpan === null) return colSpanColumnsWidth;
for (let index = 1; index < Number(colSpan); index++) {
// nextElementSibling won't be null as all the colSpan columns are rendered
colSpanColumnsWidth += currentTarget.nextElementSibling!.getBoundingClientRect().width;
Copy link
Contributor

@nstepien nstepien Sep 21, 2022

Choose a reason for hiding this comment

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

This just gets the next column's width, multiple times

  1. why? the next column is unrelated, it just doesn't work well
  2. currentTarget.nextElementSibling will be null when there's no column on the right

Recording 2022-09-21 at 11 13 19

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is not correct. I wanted to put this PR back to draft

@amanmahajan7 amanmahajan7 marked this pull request as draft September 21, 2022 11:37
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