From ebe2b9f4ce98505035405a6353c78c4168e8ac86 Mon Sep 17 00:00:00 2001 From: Miki Date: Thu, 13 Jun 2024 10:42:42 -0700 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 --- .../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) {