diff --git a/wax-prosemirror-services/src/MatchingService/components/DropDownComponent.js b/wax-prosemirror-services/src/MatchingService/components/DropDownComponent.js index f73ef480743abeae338d7abb0c58f09bd94d9b28..2d969bca5d54279b8948efcf01a4a19bb255e40f 100644 --- a/wax-prosemirror-services/src/MatchingService/components/DropDownComponent.js +++ b/wax-prosemirror-services/src/MatchingService/components/DropDownComponent.js @@ -81,7 +81,6 @@ const DropComponent = ({ getPos, node, view, uniqueId }) => { const isEditable = main.props.editable(editable => { return editable; }); - let isDisabled = !isEditable; if (node.attrs.options.length === 0) isDisabled = true; diff --git a/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js b/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js index 9eb97d8a962ee62f1547920598c1c746fed38e94..6b4175ccfa79124686abd3e186f0695819a8013f 100644 --- a/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js +++ b/wax-prosemirror-services/src/MatchingService/components/MatchingContainerComponent.js @@ -220,6 +220,24 @@ export default ({ node, view, getPos }) => { setTimeout(() => { setAddingOption(false); }); + const allNodes = getNodes(context.pmViews.main); + allNodes.forEach(singleNode => { + if (singleNode.node.attrs.id === node.attrs.id) { + singleNode.node.content.content.forEach(parentNodes => { + parentNodes.forEach(optionNode => { + if (optionNode.type.name === 'matching_option') { + /* eslint-disable-next-line no-param-reassign */ + optionNode.attrs.options = options.filter( + option => option.value !== value, + ); + if (optionNode.attrs.correct === value) { + optionNode.attrs.correct = ''; + } + } + }); + }); + } + }); }; const saveInChildOptions = allNodes => {