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

delete answer

parent 2caed18f
No related branches found
No related tags found
1 merge request!296Feedback editor
...@@ -20,7 +20,6 @@ const EditorComponent = ({ node, view, getPos }) => { ...@@ -20,7 +20,6 @@ const EditorComponent = ({ node, view, getPos }) => {
}); });
if (context.activeViewId === node.attrs.id) { if (context.activeViewId === node.attrs.id) {
console.log(node.attrs.id, 'matched');
} }
useEffect(() => { useEffect(() => {
......
...@@ -61,6 +61,10 @@ const Question = styled.div` ...@@ -61,6 +61,10 @@ const Question = styled.div`
export default ({ node, view, getPos }) => { export default ({ node, view, getPos }) => {
const context = useContext(WaxContext); const context = useContext(WaxContext);
const {
view: { main },
} = context;
const [showExplanation, setShowExplanation] = useState(false); const [showExplanation, setShowExplanation] = useState(false);
const [explanationValue, setExplanationValue] = useState(''); const [explanationValue, setExplanationValue] = useState('');
const explanationRef = useRef(null); const explanationRef = useRef(null);
...@@ -83,7 +87,15 @@ export default ({ node, view, getPos }) => { ...@@ -83,7 +87,15 @@ export default ({ node, view, getPos }) => {
} }
}; };
const removeOption = () => {}; const removeOption = () => {
main.state.doc.nodesBetween(getPos(), getPos() + 1, (nodes, pos) => {
if (nodes.attrs.id === node.attrs.id) {
main.dispatch(
main.state.tr.deleteRange(getPos(), getPos() + nodes.nodeSize + 1),
);
}
});
};
const setNoYesValues = () => {}; const setNoYesValues = () => {};
......
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