Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: set scorll postion for tag detail

shuai29f6673e9d03
diff --git a/ui/src/pages/Tags/Detail/index.tsx b/ui/src/pages/Tags/Detail/index.tsx
index a703f9a4..c58db892 100644
--- a/ui/src/pages/Tags/Detail/index.tsx
+++ b/ui/src/pages/Tags/Detail/index.tsx
@@ -31,6 +31,11 @@ const Questions: FC = () => {
object_id: tagInfo.tag_id,
});
};
+
+ useEffect(() => {
+ window.scrollTo(0, 0);
+ }, [curTagName]);
+
useEffect(() => {
if (tagResp) {
const info = { ...tagResp };
diff --git a/ui/src/pages/Tags/index.tsx b/ui/src/pages/Tags/index.tsx
index 2884be33..57663e77 100644
--- a/ui/src/pages/Tags/index.tsx
+++ b/ui/src/pages/Tags/index.tsx
@@ -111,9 +111,9 @@ const Tags = () => {
<Card.Body className="d-flex flex-column align-items-start">
<Tag className="mb-3" data={tag} />
- <p className="fs-14 flex-fill text-break text-wrap text-truncate-3 reset-p">
+ <div className="fs-14 flex-fill text-break text-wrap text-truncate-3 reset-p mb-3">
{htmlToReact(tag.parsed_text)}
- </p>
+ </div>
<div className="d-flex align-items-center">
<Button
className={`me-2 ${tag.is_follower ? 'active' : ''}`}