Does plugin's createSelectionBetween only trigger on text nodes?

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.

It’s used when converting a DOM selection to a ProseMirror selection. When you say ‘move my cursor to my star inline nodes’, I guess you’re talking about selections that are explicitly created by the editor in response to key events, and not read from the DOM.