Skip to content
Snippets Groups Projects
Commit 04165dd4 authored by chris's avatar chris
Browse files

keep selection

parent 04dd6b55
No related branches found
No related tags found
1 merge request!374Add feedback
......@@ -70,7 +70,7 @@ const Editors = () => {
case 'ncbi':
return <NCBI />;
default:
return <HHMI />;
return <Editoria />;
}
};
......
......@@ -40,6 +40,7 @@ export default {
'Base',
{
name: 'Annotations',
exclude: ['LinkTool'],
more: [
'Superscript',
'Subscript',
......
......@@ -11,7 +11,7 @@ import React, {
} from 'react';
import applyDevTools from 'prosemirror-dev-tools';
import { EditorState } from 'prosemirror-state';
import { EditorState, TextSelection } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { trackedTransaction } from 'wax-prosemirror-services';
import { WaxContext } from './WaxContext';
......@@ -81,6 +81,13 @@ const WaxView = forwardRef((props, ref) => {
attributes: {
spellcheck: browserSpellCheck ? 'true' : 'false',
},
handleDOMEvents: {
blur: (editorView, event) => {
if (view && event.relatedTarget === null) {
view.focus();
}
},
},
},
);
......
......@@ -125,6 +125,11 @@ const EditorComponent = ({ node, view, getPos }) => {
// the parent editor is focused.
if (questionView.hasFocus()) questionView.focus();
},
blur: (editorView, event) => {
if (questionView && event.relatedTarget === null) {
questionView.focus();
}
},
},
attributes: {
......
......@@ -154,6 +154,11 @@ const QuestionEditorComponent = ({ node, view, getPos }) => {
// the parent editor is focused.
if (questionView.hasFocus()) questionView.focus();
},
blur: (editorView, event) => {
if (questionView && event.relatedTarget === null) {
questionView.focus();
}
},
},
attributes: {
......
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