Skip to content

Commit

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

fixes #7177

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Changeset file for PR #7207 created/updated

---------

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 7c1f8fc commit 4ff4c3c
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 4ff4c3c

Please sign in to comment.