From 6f50e6cb477e000853982096dc336eb777b4c8f1 Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Thu, 5 May 2022 10:51:13 +0300 Subject: [PATCH] fix focus --- .../components/AnswerComponent.js | 5 +++++ .../TrueFalseQuestionService/components/AnswerComponent.js | 5 +++++ .../components/AnswerComponent.js | 5 +++++ .../components/AnswerComponent.js | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js index 6d8fb34f8..47ea3ed3a 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceSingleCorrectQuestionService/components/AnswerComponent.js @@ -131,6 +131,11 @@ export default ({ node, view, getPos }) => { Fragment.empty, ); main.dispatch(main.state.tr.replaceSelectionWith(answerOption)); + + // create Empty Paragraph + setTimeout(() => { + helpers.createEmptyParagraph(context, newAnswerId); + }, 120); } } }); diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js index 1d9cea70d..cba371caf 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseQuestionService/components/AnswerComponent.js @@ -130,6 +130,11 @@ export default ({ node, view, getPos }) => { Fragment.empty, ); main.dispatch(main.state.tr.replaceSelectionWith(answerOption)); + + // create Empty Paragraph + setTimeout(() => { + helpers.createEmptyParagraph(context, newAnswerId); + }, 120); } } }); diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js index 431d7f6e9..a939693f7 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/TrueFalseSingleCorrectQuestionService/components/AnswerComponent.js @@ -130,6 +130,11 @@ export default ({ node, view, getPos }) => { Fragment.empty, ); main.dispatch(main.state.tr.replaceSelectionWith(answerOption)); + + // create Empty Paragraph + setTimeout(() => { + helpers.createEmptyParagraph(context, newAnswerId); + }, 120); } } }); diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js index 313d88a32..c4b4574da 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/components/AnswerComponent.js @@ -10,6 +10,7 @@ import { Icon } from 'wax-prosemirror-components'; import EditorComponent from './EditorComponent'; import SwitchComponent from './SwitchComponent'; import FeedbackComponent from './FeedbackComponent'; +import helpers from '../helpers/helpers'; const Wrapper = styled.div` display: flex; @@ -129,6 +130,10 @@ export default ({ node, view, getPos }) => { Fragment.empty, ); main.dispatch(main.state.tr.replaceSelectionWith(answerOption)); + // create Empty Paragraph + setTimeout(() => { + helpers.createEmptyParagraph(context, newAnswerId); + }, 120); } } }); -- GitLab