diff --git a/changelogs/fragments/7058.yml b/changelogs/fragments/7058.yml new file mode 100644 index 000000000000..ff86e5e65b8d --- /dev/null +++ b/changelogs/fragments/7058.yml @@ -0,0 +1,2 @@ +fix: +- [Discover] Allow the last column of a table wider than the window to show up properly ([#7058](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7058)) 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 5bcc55666f7c..436a401527fe 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 @@ -192,14 +192,11 @@ const DefaultDiscoverTableUI = ({ * 1) prevent columns from changing size when more rows are added, and * 2) speed of rendering time of subsequently added rows. * - * First cell is skipped because it has a dimention set already, and the last cell is skipped to allow it to - * grow as much as the table needs. + * First cell is skipped because it has a fixed dimension set already. */ - tableElement - .querySelectorAll('thead > tr > th:not(:first-child):not(:last-child)') - .forEach((th) => { - (th as HTMLTableCellElement).style.width = th.getBoundingClientRect().width + 'px'; - }); + tableElement.querySelectorAll('thead > tr > th:not(:first-child)').forEach((th) => { + (th as HTMLTableCellElement).style.width = th.getBoundingClientRect().width + 'px'; + }); tableElement.style.tableLayout = 'fixed'; }