Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.15] [Discover] Allow the last column of a table wider than the window to show up properly #7066

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading