From d8f91720007ac1ec07168fefe4568400cbd74035 Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Sun, 21 Apr 2024 23:29:14 +0300
Subject: [PATCH] update position

---
 .../src/CommentsService/components/RightArea.js          | 1 -
 .../src/CommentsService/plugins/CommentState.js          | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/wax-prosemirror-services/src/CommentsService/components/RightArea.js b/wax-prosemirror-services/src/CommentsService/components/RightArea.js
index d62b3c771..d2e7869b8 100644
--- a/wax-prosemirror-services/src/CommentsService/components/RightArea.js
+++ b/wax-prosemirror-services/src/CommentsService/components/RightArea.js
@@ -81,7 +81,6 @@ export default ({ area, users }) => {
             WaxSurface.top +
             parseInt(WaxSurfaceMarginTop.slice(0, -2), 10);
         } else if (!isFirstRun) {
-          console.log('else');
           // comment is deleted from editing surface
           context.setOption({ resolvedComment: id });
           context.setOption({
diff --git a/wax-prosemirror-services/src/CommentsService/plugins/CommentState.js b/wax-prosemirror-services/src/CommentsService/plugins/CommentState.js
index 314d202ac..a386e6d70 100644
--- a/wax-prosemirror-services/src/CommentsService/plugins/CommentState.js
+++ b/wax-prosemirror-services/src/CommentsService/plugins/CommentState.js
@@ -194,6 +194,15 @@ export default class CommentState {
       transaction.doc,
     );
 
+    map.forEach((annotation, _) => {
+      if ('from' in annotation && 'to' in annotation) {
+        annotation.data.pmFrom = transaction.mapping.map(
+          annotation.data.pmFrom,
+        );
+        annotation.data.pmTo = transaction.mapping.map(annotation.data.pmTo);
+      }
+    });
+
     if (ystate?.binding && ystate?.binding.mapping) {
       this.updateCommentPostions(ystate);
       return this;
-- 
GitLab