diff --git a/wax-prosemirror-components/src/components/Button.js b/wax-prosemirror-components/src/components/Button.js index 1bf067ac080a881bb58da775cb4ec52bc17035d1..4c4e8fab4c42bb9ef6eba6a373c4147d97843848 100644 --- a/wax-prosemirror-components/src/components/Button.js +++ b/wax-prosemirror-components/src/components/Button.js @@ -5,12 +5,12 @@ import MenuButton from '../ui/buttons/MenuButton'; const Button = ({ view = {}, item }) => { const { active, icon, label, run, select, title } = item; - + const context = useContext(WaxContext); const { view: { main }, activeViewId, activeView, - } = useContext(WaxContext); + } = context; const isEditable = main.props.editable(editable => { return editable; @@ -44,7 +44,7 @@ const Button = ({ view = {}, item }) => { title={title} /> ), - [isActive, isDisabled], + [isActive, isDisabled, activeViewId], ); return MenuButtonComponent; diff --git a/wax-prosemirror-components/src/components/images/ImageUpload.js b/wax-prosemirror-components/src/components/images/ImageUpload.js index 2a17ebbb7547b5a49aefcd01b41d1a18a4fa0fd9..3b4edd6c15d892de15063ba9109afd9abb4355e1 100644 --- a/wax-prosemirror-components/src/components/images/ImageUpload.js +++ b/wax-prosemirror-components/src/components/images/ImageUpload.js @@ -93,7 +93,7 @@ const ImageUpload = ({ item, fileUpload, view }) => { </label> </Wrapper> ), - [isDisabled], + [isDisabled, activeViewId], ); return ImageUploadComponent; diff --git a/wax-prosemirror-services/src/EssayService/EssayQuestion.js b/wax-prosemirror-services/src/EssayService/EssayQuestion.js index dc85658ad28acaecf90abb4143019cf054e3d667..6b6073928e0f8e78a3609e3cee530647486c9471 100644 --- a/wax-prosemirror-services/src/EssayService/EssayQuestion.js +++ b/wax-prosemirror-services/src/EssayService/EssayQuestion.js @@ -96,10 +96,10 @@ class EssayQuestion extends Tools { tr.replaceSelectionWith(essayAnswer); dispatch(tr); - // setTimeout(() => { - // createEmptyParagraph(context, essayQuestion.attrs.id); - // createEmptyParagraph(context, essayAnswer.attrs.id); - // }, 50); + setTimeout(() => { + createEmptyParagraph(context, essayAnswer.attrs.id); + createEmptyParagraph(context, essayQuestion.attrs.id); + }, 50); }; } diff --git a/wax-prosemirror-services/src/EssayService/components/EssayAnswerComponent.js b/wax-prosemirror-services/src/EssayService/components/EssayAnswerComponent.js index 9792280a5fe6880b1946cb64178b485e724b61c5..bc48c849f9b92cfe3386fb862da0bac54b717f25 100644 --- a/wax-prosemirror-services/src/EssayService/components/EssayAnswerComponent.js +++ b/wax-prosemirror-services/src/EssayService/components/EssayAnswerComponent.js @@ -15,7 +15,7 @@ import { liftListItem, sinkListItem, } from 'prosemirror-schema-list'; -import Placeholder from '../plugins/placeholder'; +import Placeholder from '../../MultipleChoiceQuestionService/plugins/placeholder'; const EditorWrapper = styled.div` border: none; diff --git a/wax-prosemirror-services/src/EssayService/components/EssayQuestionComponent.js b/wax-prosemirror-services/src/EssayService/components/EssayQuestionComponent.js index ea1b7b3264352b6cd5f640cdf19c6d5ab27edc08..2337e0530834f9a794008968fa3b544f6a610ecc 100644 --- a/wax-prosemirror-services/src/EssayService/components/EssayQuestionComponent.js +++ b/wax-prosemirror-services/src/EssayService/components/EssayQuestionComponent.js @@ -15,7 +15,7 @@ import { liftListItem, sinkListItem, } from 'prosemirror-schema-list'; -import Placeholder from '../plugins/placeholder'; +import Placeholder from '../../MultipleChoiceQuestionService/plugins/placeholder'; const EditorWrapper = styled.div` border: none; @@ -150,6 +150,9 @@ const EssayQuestionComponent = ({ node, view, getPos }) => { if (essayQuestionView.hasFocus()) essayQuestionView.focus(); }, }, + handleClickOn: () => { + context.updateView({}, questionId); + }, attributes: { spellcheck: 'false',