feat: realtime comments (#1144)

* init

* fix: close bubblemenu after comment and wait before scroll

* scroll to comment when click

* highlight comment animation
This commit is contained in:
fuscodev
2025-05-16 17:18:23 +02:00
committed by GitHub
parent 00f4588c21
commit 1413033568
9 changed files with 96 additions and 12 deletions

View File

@ -219,9 +219,12 @@ export default function PageEditor({
setActiveCommentId(commentId);
setAsideState({ tab: "comments", isAsideOpen: true });
const selector = `div[data-comment-id="${commentId}"]`;
const commentElement = document.querySelector(selector);
commentElement?.scrollIntoView();
//wait if aside is closed
setTimeout(() => {
const selector = `div[data-comment-id="${commentId}"]`;
const commentElement = document.querySelector(selector);
commentElement?.scrollIntoView({ behavior: "smooth", block: "center" });
}, 400);
};
useEffect(() => {