Skip to content

Commit

Permalink
Optimize scrolling behavior of Discover table (#7017)
Browse files Browse the repository at this point in the history
* Optimize scrolling behavior of Discover table

This is an improvement to #6683

Signed-off-by: Miki <miki@amazon.com>
(cherry picked from commit ebe2b9f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jun 13, 2024
1 parent ce27890 commit 0cfcaaf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ const DefaultDiscoverTableUI = ({
if (tableElement) {
// Load the first batch of rows and adjust the columns to the contents
tableElement.style.tableLayout = 'auto';
// To prevent influencing the auto-sizing, unset the widths from a previous render
tableElement.querySelectorAll('thead > tr > th:not(:first-child)').forEach((th) => {
(th as HTMLTableCellElement).style.width = 'unset';
});

tableLayoutRequestFrameRef.current = requestAnimationFrame(() => {
if (tableElement) {
Expand Down

0 comments on commit 0cfcaaf

Please sign in to comment.