UX: Fix search topic titles wrapping (#13315)
A followup to e3b0abc and a replacement PR for #13298. Fixes long topic titles wrapping to a separate line in the dropdown search results. Also replaces divs that were incorrectly nested inside spans.
This commit is contained in:
parent
f90c4bd6a1
commit
1cd189aabf
|
@ -161,9 +161,7 @@ createSearchResult({
|
|||
this.siteSettings.use_pg_headlines_for_excerpt &&
|
||||
result.topic_title_headline
|
||||
? new RawHtml({
|
||||
html: `<span>${emojiUnescape(
|
||||
result.topic_title_headline
|
||||
)}</span>`,
|
||||
html: emojiUnescape(result.topic_title_headline),
|
||||
})
|
||||
: new Highlighted(topic.fancyTitle, term)
|
||||
),
|
||||
|
@ -182,8 +180,8 @@ createSearchResult({
|
|||
}
|
||||
|
||||
const link = h("span.topic", [
|
||||
h("div.first-line", firstLine),
|
||||
h("div.second-line", secondLine),
|
||||
h("span.first-line", firstLine),
|
||||
h("span.second-line", secondLine),
|
||||
]);
|
||||
|
||||
return postResult.call(this, result, link, term);
|
||||
|
|
|
@ -6,7 +6,7 @@ import { h } from "virtual-dom";
|
|||
import { iconNode } from "discourse-common/lib/icon-library";
|
||||
|
||||
export default createWidget("topic-status", {
|
||||
tagName: "div.topic-statuses",
|
||||
tagName: "span.topic-statuses",
|
||||
|
||||
html(attrs) {
|
||||
const topic = attrs.topic;
|
||||
|
|
|
@ -71,6 +71,11 @@
|
|||
}
|
||||
|
||||
.search-result-topic {
|
||||
.first-line {
|
||||
display: block;
|
||||
line-height: $line-height-medium;
|
||||
}
|
||||
|
||||
.second-line {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
@ -273,14 +278,12 @@
|
|||
}
|
||||
|
||||
.topic {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.topic-title {
|
||||
display: inline-block;
|
||||
color: var(--tertiary);
|
||||
overflow-wrap: anywhere;
|
||||
line-height: $line-height-medium;
|
||||
@supports not (overflow-wrap: anywhere) {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue