Skip to content
Snippets Groups Projects
Commit 1467d3df authored by chris's avatar chris
Browse files

set active comment on creation

parent 948f110d
No related branches found
No related tags found
1 merge request!109Track changes ids
......@@ -94,7 +94,7 @@ export default ({ comment, view, top, dataBox }) => {
ref={commentInput}
placeholder="add a new comment"
onKeyPress={handleKeyDown}
// autoFocus
autoFocus
/>
<button onClick={saveComment}>Post</button>
<button>Cancel</button>
......
......@@ -6,8 +6,6 @@ import { DocumentHelpers } from "wax-prosemirror-utilities";
const activeComment = new PluginKey("activeComment");
const getComment = state => {
if (state.selection.from !== state.selection.to) return;
const commentMark = state.schema.marks["comment"];
const commentOnSelection = DocumentHelpers.findMark(state, commentMark);
......@@ -42,6 +40,12 @@ const getComment = state => {
};
}
}
if (
state.selection.from !== state.selection.to &&
commentOnSelection &&
commentOnSelection.attrs.conversation.length
)
return;
return commentOnSelection;
};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment