Skip to content

Commit 4ba8cde

Browse files
authored
fix: (backport) text truncate issue in the search modal (#2151)
1 parent 86d0a7e commit 4ba8cde

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/search-modal/SearchModal.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,13 @@
6666
background-color: unset;
6767
}
6868
}
69+
70+
// Fix a bug with search modal: very long text is not truncated with an ellipsis
71+
// https://github.com/openedx/frontend-app-authoring/issues/1900
72+
.hit-description {
73+
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
74+
-webkit-line-clamp: 1;
75+
-webkit-box-orient: vertical;
76+
overflow: hidden;
77+
}
6978
}

src/search-modal/SearchResult.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const SearchResult: React.FC<{ hit: ContentHit }> = ({ hit }) => {
181181
<div className="hit-name small">
182182
<Highlight text={hit.formatted.displayName} />
183183
</div>
184-
<div className="hit-description x-small text-truncate">
184+
<div className="hit-description x-small">
185185
<Highlight text={hit.formatted.content?.htmlContent ?? ''} />
186186
<Highlight text={hit.formatted.content?.capaContent ?? ''} />
187187
</div>

0 commit comments

Comments
 (0)