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

give unique ids

parent dbd8892d
No related branches found
No related tags found
1 merge request!374Add feedback
This commit is part of merge request !374. Comments created here will be created in the context of that merge request.
......@@ -53,14 +53,11 @@ export default class FillTheGapContainerNodeView extends AbstractNodeView {
if (event.target.type === 'text') {
return true;
}
return (
this.context.view[this.node.attrs.id] !== undefined &&
event.target !== undefined &&
this.context.view[this.node.attrs.id].dom.contains(event.target)
);
}
ignoreMutation() {
return true;
}
}
import { injectable } from 'inversify';
import { wrapIn } from 'prosemirror-commands';
import { v4 as uuidv4 } from 'uuid';
import Tools from '../lib/Tools';
@injectable()
......@@ -10,7 +11,9 @@ class FillTheGapQuestion extends Tools {
get run() {
return (state, dispatch) => {
wrapIn(state.config.schema.nodes.fill_the_gap_container)(state, dispatch);
wrapIn(state.config.schema.nodes.fill_the_gap_container, {
id: uuidv4(),
})(state, dispatch);
};
}
......
......@@ -32,6 +32,7 @@ const EditorWrapper = styled.span`
`;
const EditorComponent = ({ node, view, getPos }) => {
console.log(node);
const editorRef = useRef();
const context = useContext(WaxContext);
......
import { v4 as uuidv4 } from 'uuid';
const fillTheGapContainerNode = {
attrs: {
id: { default: uuidv4() },
id: { default: '' },
class: { default: 'fill-the-gap' },
},
group: 'block questions',
atom: true,
draggable: true,
selectable: true,
defining: true,
content: 'paragraph+',
parseDOM: [
......
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