diff --git a/wax-prosemirror-services/src/CommentsService/components/ui/comments/CommentBubbleComponent.js b/wax-prosemirror-services/src/CommentsService/components/ui/comments/CommentBubbleComponent.js index eb9b7f5034ef1cb13b7d4fb51091988466ddbd97..ecc6798333a2868707918f6dbe7e0cc6638e7d4a 100644 --- a/wax-prosemirror-services/src/CommentsService/components/ui/comments/CommentBubbleComponent.js +++ b/wax-prosemirror-services/src/CommentsService/components/ui/comments/CommentBubbleComponent.js @@ -36,21 +36,24 @@ const CommentBubbleComponent = ({ setPosition, position, group }) => { event.preventDefault(); const { selection } = state; - if (context.app.config.get('config.YjsService')) { - return createYjsComments(selection); - } + // if (context.app.config.get('config.YjsService')) { + // return createYjsComments(selection); + // } + + const fromPos = state.tr.mapping.map(selection.from); + const toPos = state.tr.mapping.map(selection.to); dispatch( state.tr.setMeta(CommentDecorationPluginKey, { type: 'addComment', - from: selection.from, - to: selection.to, + from: fromPos, + to: toPos, data: { type: 'comment', - yjsFrom: selection.from, - yjsTo: selection.to, - pmFrom: selection.from, - pmTo: selection.to, + yjsFrom: fromPos, + yjsTo: toPos, + pmFrom: fromPos, + pmTo: toPos, conversation: [], title: '', group,