I am trying to build a menu inside a table cell and able to do that by specifying a span node in the spec and adding it to the cellContent.
tableGroup: "block",
cellContent: "spanNode block+",
cellAttributes: {
background: {...
And the spanNode looks something like this:
spanNode: {
atom: true,
isolating: true,
parseDOM: [{tag: "span"}],
toDOM() { return ["span", {class: "dropdown-menu"}] }
},
Now I am able to generate the span node as expected and able to add a menu to the span node.
The problem is when I select a (or multiple) cell and type in a character, the character is splitting the table into two by creating a new paragraph node instead of deleting and appending to the current cell’s text node.I tried to set the isolating
flag to true on the spanNode, but it didn’t make a difference.
Reading similar posts that talk about using filterTransaction
, I am not sure if I really have to go that route. At this point, I want to pause and see if anyone else encountered the same and if so, any suggestions for me?
Thanks!