diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js index d27735b7ff36496872f073f2e4bb29ee02eaf852..8b36b99246ba9f64719f536dbf8801b8982f7721 100644 --- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/MultipleChoiceQuestionService.js @@ -12,8 +12,16 @@ import MultipleChoiceSingleCorrectQuestionService from './MultipleChoiceSingleCo import TrueFalseQuestionService from './TrueFalseQuestionService/TrueFalseQuestionService'; import TrueFalseSingleCorrectQuestionService from './TrueFalseSingleCorrectQuestionService/TrueFalseSingleCorrectQuestionService'; import './multipleQuestionStyles.css'; +import MoveCursorPlugin from './plugins/MoveCursorPlugin'; class MultipleChoiceQuestionService extends Service { + boot() { + this.app.PmPlugins.add( + 'moveCursorPlugin', + MoveCursorPlugin('moveCursorPlugin'), + ); + } + register() { this.container.bind('MultipleChoiceQuestion').to(MultipleChoiceQuestion); const createNode = this.container.get('CreateNode'); diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/plugins/MoveCursorPlugin.js b/wax-prosemirror-services/src/MultipleChoiceQuestionService/plugins/MoveCursorPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..2b910dffd5e12f0cb8b83af913a667300958ab7f --- /dev/null +++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/plugins/MoveCursorPlugin.js @@ -0,0 +1,21 @@ +import { Plugin, PluginKey } from 'prosemirror-state'; + +const testPlugin = new PluginKey('moveCursorPlugin'); + +export default () => { + return new Plugin({ + key: testPlugin, + filterTransaction: (transaction, state) => { + // if ( + // transaction.getMeta('fromOutside') && + // transaction.doc && + // transaction.doc.type && + // transaction.doc.type.name === 'multiple_drop_down_container' + // ) { + // return false; + // } + + return true; + }, + }); +};