Skip to content

Commit

Permalink
Optimize scrolling behavior of Discover table
Browse files Browse the repository at this point in the history
This is an improvement to opensearch-project#6683

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Jun 13, 2024
1 parent b5ec877 commit b136393
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,9 @@ const DefaultDiscoverTableUI = ({
// 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):not(:last-child)')
.forEach((th) => {
(th as HTMLTableCellElement).style.width = 'unset';
});
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 b136393

Please sign in to comment.