fix: fixing broken corners of table with sticky header bottom when scrolled #3291
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for Sticky Header breaking bottom border at corners
The current implementation of the sticky header component can lead to a visual issue where the bottom corners of the sticky header jut out past the rounded borders of the table, causing a break in the visible border.
This pull request addresses this issue by making an enhancement to the useStickyHeader hook used by the Sticky Header and its parent component.
The key changes are:
Adding a new property called
isStuckAtBottom
to the object returned by the useStickyHeader hook. The isStuckAtBottom state is introduced to track whether the sticky header is aligned with the bottom edge of the table content. This is determined by comparing the bottom positions of the table container and the sticky header, and setting isStuckAtBottom accordingly. The internal table component then uses this state to apply an additional CSS class when the sticky header is in use, is stuck, and is stuck at the bottom edge, enabling the fix for the visual issue with the bottom border corners.This fix should resolve the issue described in AWSUI-60364, providing a seamless visual experience for users when working with sticky headers in tables.
How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.