Hello!
I’m currently working on an extension (3 new node types in fact) and having issues with gapCursor. Here’s more details on my setup:
Let’s call my extensions:
- wrapper (content: ‘header panel’)
- header (content: ‘block*’)
- panel (content: ‘block*’)
I’m using latest tiptap2 packages.
When inserting new content, it’s like this:
{
type: 'wrapper',
content: [
{
type: 'header',
content: ...
},
{
type: 'panel',
content: ...
},
],
}
All node types have the following properties:
- isolating: true
- allowGapCursor: false
- selectable: false
My issue is that in 3 different scenarios, I’m still getting a gapCursor (even if allowGapCursor is false), but as soon as this gapCursor appears, it breaks the editor, everything stops working, I need to reload to fix it. These scenarios are:
- If my wrapper node is the first node of the document and I do “arrow up” or “arrow left”
- If my wrapper node is the last node of the document and I try to go further down
- If I have 2 consecutive wrapper nodes, when traversing from one to the other using the arrows
When the editor breaks, I get the following trace
index.es.js?576a:1127 Uncaught TypeError: this.widget.type.destroy is not a function
at WidgetViewDesc.destroy (index.es.js?576a:1127)
at ViewTreeUpdater.destroyBetween (index.es.js?576a:1762)
at ViewTreeUpdater.updateNextNode (index.es.js?576a:1877)
at eval (index.es.js?576a:1341)
at iterDeco (index.es.js?576a:1990)
at NodeViewDesc.updateChildren (index.es.js?576a:1325)
at NodeViewDesc.updateInner (index.es.js?576a:1421)
at NodeViewDesc.update (index.es.js?576a:1413)
at EditorView.updateStateInner (index.es.js?576a:5026)
at EditorView.updateState (index.es.js?576a:4978)
anyone have an idea about what I’m doing wrong / what I can do to fix this?
Thanks a lot!