Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-table] Fix horizontal scrolling for Table Sections. #2060

Merged
merged 16 commits into from
Mar 15, 2024

Conversation

kenk2
Copy link
Contributor

@kenk2 kenk2 commented Mar 1, 2024

Summary

What was changed:
The boundingRef prop is being removed in favor of using the table's internal container ref for calculating the offset needed for making the section headers sticky when scrolling horizontally.

We are no longer utilizing isTitleFixed for the Section Headers inside table. Instead we are using isTitleSticky This PR fixes vertical scrolling for Section Headers within Tables.

Why it was changed:

Consumer was reporting that section headers are not working when scrolling vertically.

Testing

This change was tested using:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-10264


Thank you for contributing to Terra.
@cerner/terra

@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 1, 2024 22:30 Destroyed
@kenk2 kenk2 marked this pull request as draft March 1, 2024 22:35
@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 1, 2024 22:39 Destroyed
Copy link
Contributor

github-actions bot commented Mar 1, 2024

Fails
🚫 Please include a CHANGELOG entry for each changed package this PR. Looks like a CHANGELOG entry is missing for:
  • terra-framework-docs

Generated by 🚫 dangerJS against 768cbf2

@kenk2
Copy link
Contributor Author

kenk2 commented Mar 1, 2024

The change in terra-framework-docs does not affect consumers. No changelog is needed.

@kenk2
Copy link
Contributor Author

kenk2 commented Mar 1, 2024

Screens:
Before:
Screenshot 2024-03-01 at 3 00 30 PM
After:
Screenshot 2024-03-01 at 3 00 36 PM

@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 8, 2024 21:12 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 12, 2024 21:47 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 13, 2024 18:34 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 13, 2024 18:35 Destroyed
@kenk2 kenk2 marked this pull request as ready for review March 13, 2024 18:43
Copy link
Contributor

@adoroshk adoroshk left a comment

Choose a reason for hiding this comment

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

Works as expected. LGTM
Screenshot 2024-03-13 at 3 38 30 PM

@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 14, 2024 14:16 Destroyed
Copy link
Contributor

@nikhitasharma nikhitasharma left a comment

Choose a reason for hiding this comment

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

LGTM, left one nit docs comment.

@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 14, 2024 19:03 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 15, 2024 18:38 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 15, 2024 18:53 Destroyed
@kenk2 kenk2 requested review from nikhitasharma and adoroshk March 15, 2024 19:10
Copy link
Contributor

@adoroshk adoroshk left a comment

Choose a reason for hiding this comment

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

Re-tested to ensure the new changes work as expected. LGTM.
Screenshot 2024-03-15 at 3 21 59 PM

Comment on lines -112 to -115
/**
* Bounding container for the flowsheet grid, will use window if no value provided.
*/
boundingRef: PropTypes.func,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason this prop is being removed? Because this would be a breaking change.

Copy link
Contributor Author

@kenk2 kenk2 Mar 15, 2024

Choose a reason for hiding this comment

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

The reason this is being removed is that we should not be forcing consumers to use a bounding ref in order to make the section headers sticky. Instead we are using the internal table container to control the sticky behavior. After this PR the sticky header will continue as before, but the component will not require this div anymore.

For current consumers, they will have the same experience, just that boundingRef will do nothing anymore. It should be a passive change for consumers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense +1

Copy link
Contributor

@sdadn sdadn left a comment

Choose a reason for hiding this comment

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

Small nit regarding documentation for consumers.

Comment on lines 5 to 7
* Changed
* `boundingRef` is no longer necessary for the section header's sticky behavior. The calculation now uses the table's container ref for calculating the offset.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
* Changed
* `boundingRef` is no longer necessary for the section header's sticky behavior. The calculation now uses the table's container ref for calculating the offset.
* Removed
* Removed the `boundingRef` prop in favor of using the table's container ref for calculating the offset. is no longer needed for the section header's sticky behavior. This change is still passive in nature as it doesn't change any functionality for consumers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -2,6 +2,9 @@

## Unreleased

* Changed
* Table now uses its own container ref for calculating the offset while scrolling horizontally. `boundingRef` is no longer necessary for the scrolling behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Same suggestion as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@github-actions github-actions bot temporarily deployed to preview-pr-2060 March 15, 2024 19:55 Destroyed
@kenk2 kenk2 merged commit 0c1c4cc into main Mar 15, 2024
17 of 22 checks passed
@kenk2 kenk2 deleted the table-section-fix branch March 15, 2024 20:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants