fix: Text truncate issue in the search modal (#2137)

This commit is contained in:
bydawen
2025-06-14 02:28:29 +03:00
committed by GitHub
parent 2e9b5b7e78
commit fcf1e5cb33
2 changed files with 11 additions and 1 deletions

View File

@@ -66,4 +66,13 @@
background-color: unset;
}
}
// Fix a bug with search modal: very long text is not truncated with an ellipsis
// https://github.com/openedx/frontend-app-authoring/issues/1900
.hit-description {
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
}

View File

@@ -181,7 +181,7 @@ const SearchResult: React.FC<{ hit: ContentHit }> = ({ hit }) => {
<div className="hit-name small">
<Highlight text={hit.formatted.displayName} />
</div>
<div className="hit-description x-small text-truncate">
<div className="hit-description x-small">
<Highlight text={hit.formatted.content?.htmlContent ?? ''} />
<Highlight text={hit.formatted.content?.capaContent ?? ''} />
</div>
@@ -190,6 +190,7 @@ const SearchResult: React.FC<{ hit: ContentHit }> = ({ hit }) => {
</div>
</Stack>
<IconButton
className="flex-shrink-0"
src={OpenInNew}
iconAs={Icon}
onClick={openContextInNewWindow}