Skip to content
Snippets Groups Projects
Commit 5ce22c6d authored by chris's avatar chris
Browse files

fix type

parent f5a84b89
No related branches found
No related tags found
1 merge request!519Move tool groups
......@@ -59,13 +59,13 @@ const backSpaceShortCut = (state, dispatch, view) => {
};
const pressEnter = (state, dispatch) => {
const { $from, to, from } = state.selection;
// Images
if (state.selection.$head.parent.type.name === 'figcaption') {
if (state.doc.resolve(from).parent.type.name === 'figcaption') {
return true;
}
if (state.selection.node && state.selection.node.type.name === 'image') {
const { $from, to } = state.selection;
const same = $from.sharedDepth(to);
const pos = $from.before(same);
......@@ -88,8 +88,8 @@ const pressEnter = (state, dispatch) => {
if (
title.length === 1 &&
state.selection.from > title[0].pos + 1 &&
state.selection.from < title[0].pos + title[0].node.nodeSize - 1
from > title[0].pos + 1 &&
from < title[0].pos + title[0].node.nodeSize - 1
) {
return true;
}
......
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