tiptap: hide drag handler in topNode

pull/160/head
fantasticit 2022-08-15 11:08:22 +08:00
parent 1f2b4819d8
commit dbf87fec68
1 changed files with 4 additions and 1 deletions

View File

@ -145,10 +145,11 @@ export const Dragable = Extension.create({
}
const result = selectRootNodeByDom(dom, view);
activeNode = result;
if (
!result ||
result.node.type.name === 'doc' ||
result.node.type.name === 'documentWithTitle' ||
result.node.type.name === 'title' ||
result.node.type.name === 'tableOfContents' ||
// empty paragraph
@ -159,6 +160,8 @@ export const Dragable = Extension.create({
return false;
}
activeNode = result;
renderDragHandleDOM(view, result.el);
return false;
},