Skip to content

Properly update TableView row width when it is the last column remaining #2028

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

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Jun 15, 2021

Closes #1153

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Go to http://localhost:9003/?path=/story/tableview--hiding-columns
Hide all columns via clicking each checkbox
Hover each row and make sure the highlight extends to the end of the table

🧢 Your Project:

tableview row width was not updating properly when the 2nd to last column was removed because we were not detecting the width change
Comment on lines +870 to +871
// Uses equals rather than pointEquals so that width/height changes are taken into account
!cur.rect.equals(layoutInfo.rect) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

If all columns were removed/hidden except the left most column, the x, y position of the rect doesn't shift but the width changes. Changed to rect.equals instead of rect.pointEquals so that this case is properly captured

@adobe-bot
Copy link

Build successful! 🎉

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

lgtm!

@snowystinger snowystinger added the small review Easy to review PR label Jun 15, 2021
@LFDanLu LFDanLu merged commit 4ffc644 into main Jun 16, 2021
@LFDanLu LFDanLu deleted the issue_1283 branch June 16, 2021 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small review Easy to review PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table row highlight is truncated if table is displaying only 1 column
4 participants