Skip to content
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
9 changes: 9 additions & 0 deletions src/search-modal/SearchModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
3 changes: 2 additions & 1 deletion src/search-modal/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -190,6 +190,7 @@ const SearchResult: React.FC<{ hit: ContentHit }> = ({ hit }) => {
</div>
</Stack>
<IconButton
className="flex-shrink-0"
src={OpenInNew}
iconAs={Icon}
onClick={openContextInNewWindow}
Expand Down