Skip to content

Commit

Permalink
fix(discover): break new lines in table cell (#7207) (#7468)
Browse files Browse the repository at this point in the history
* fix(discover): break new lines in table cell

fixes #7177



* Changeset file for PR #7207 created/updated

---------



(cherry picked from commit 4ff4c3c)

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 25, 2024
1 parent 62f5883 commit 95b2ef6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7207.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Break new lines in table cell in legacy discover ([#7207](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7207))
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,7 @@ $osdDocTableCellPadding: calc($ouiSizeM / 2); // corresponds to DataGrid medium
font-size: inherit !important;
}
}

.osdDocTableCell__dataField {
white-space: pre-wrap;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ const TableCellUI = ({
}: TableCellProps) => {
const content = (
<>
{/* eslint-disable-next-line react/no-danger */}
<span dangerouslySetInnerHTML={{ __html: sanitizedCellValue }} />
<span
className="osdDocTableCell__dataField"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: sanitizedCellValue }}
/>
<span className="osdDocTableCell__filter">
<EuiToolTip
content={i18n.translate('discover.filterForValue', {
Expand Down

0 comments on commit 95b2ef6

Please sign in to comment.