WHY AM I ASKING THIS QUESTION
Honestly, I’m just exploring how Prosemirror works.
QUESTION Does plugin’s createSelectionBetween only trigger on text nodes?
I have this doc:
let doc = schema.node("doc", null, [
schema.node("paragraph", null, [
schema.node("star"),
schema.node("star"),
schema.node("star"),
schema.text("123"),
schema.node("star"),
]),
])
Star is just a custom node of this format:
star: {
inline: true,
group: "inline",
toDOM() { return ["star", "🟊"] },
parseDOM: [{ tag: "star" }]
},
It doesn’t do much but return 🟊 as html element.
So I tried adding createSelectionBetween
to one of my WIP plugins, and it seems to only trigger on text selection. Whenever I move my cursor to my star inline nodes, that doesn’t trigger.
Is that intended? I don’t quite understand when createSelectionBetween
is supposed to trigger.