From 0cfcaaf70422555e5e520f20d9491cebdf85633e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Jun 2024 17:44:23 +0000 Subject: [PATCH] Optimize scrolling behavior of Discover table (#7017) * Optimize scrolling behavior of Discover table This is an improvement to #6683 Signed-off-by: Miki (cherry picked from commit ebe2b9f4ce98505035405a6353c78c4168e8ac86) Signed-off-by: github-actions[bot] --- .../default_discover_table/default_discover_table.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx b/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx index a66a9044873b..5bcc55666f7c 100644 --- a/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx +++ b/src/plugins/discover/public/application/components/default_discover_table/default_discover_table.tsx @@ -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) {