Skip to content

Commit

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

This is an improvement to #6683


(cherry picked from commit ebe2b9f)

Signed-off-by: Miki <miki@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 8f2bb5e commit 7674d3c
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 7674d3c

Please sign in to comment.