diff --git a/wax-prosemirror-components/src/components/comments/Comment.js b/wax-prosemirror-components/src/components/comments/Comment.js index f24c6b777ee7c450bed796697d46ad4d5d62ca7d..e0b9f1205733c0608d4235014ca0774e1299046d 100644 --- a/wax-prosemirror-components/src/components/comments/Comment.js +++ b/wax-prosemirror-components/src/components/comments/Comment.js @@ -9,6 +9,7 @@ import { v4 as uuidv4 } from "uuid"; import styled from "styled-components"; import { WaxContext } from "wax-prosemirror-core"; +import { DocumentHelpers } from "wax-prosemirror-utilities"; const SinlgeCommentRow = styled.div` padding: 4px; @@ -36,11 +37,12 @@ export default ({ comment, activeView, user }) => { const obj = { [user.username]: value }; commentAnnotation.attrs.conversation.push(obj); + const actualComment = DocumentHelpers.findMark(state, commentMark); dispatch( tr.addMark( - commentAnnotation.pos, - commentAnnotation.pos + commentAnnotation.node.nodeSize, + actualComment.from, + actualComment.to, commentMark.create({ ...((commentAnnotation && commentAnnotation.attrs) || {}), conversation: commentAnnotation.attrs.conversation diff --git a/wax-prosemirror-components/src/components/rightArea/RightArea.js b/wax-prosemirror-components/src/components/rightArea/RightArea.js index 4eae5f947e1c1c93273d180ac1b32035d62a873c..fe0fc66e1504872deb8251c24ebfc3d723a9d9a0 100644 --- a/wax-prosemirror-components/src/components/rightArea/RightArea.js +++ b/wax-prosemirror-components/src/components/rightArea/RightArea.js @@ -156,7 +156,6 @@ const updateMarks = view => { mark.type.name === "format_change" ) { mark.pos = node.pos; - mark.node = node.node; finalMarks.push(mark); } });