Skip to content

Commit

Permalink
[Discover] Allow the last column of a table wider than the window to …
Browse files Browse the repository at this point in the history
…show up properly (#7058)

Signed-off-by: Miki <miki@amazon.com>
(cherry picked from commit 7aa61e4)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jun 19, 2024
1 parent 471a63e commit 5f5c7ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7058.yml
Original file line number Diff line number Diff line change
@@ -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))
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 5f5c7ad

Please sign in to comment.