Is there a way to tell a NodeView at which index of a group it sits?

I have a use case where I want the output of a NodeView to change depending on if it is the last one of its type in a group. Let’s say I have a schema like

doc: {
        content: "header bullet+ main"
    }

and bullet corresponds to a NodeView, is there a way for that NodeView to know whether it is the last bullet NodeView to be rendered?

No, node views are ‘context less’, in that they don’t get updated when their surroundings change, only when their content/attributes change. To notify them of other information the recommended approach is to have a plugin add node decorations (which node view update methods can read) with the relevant information attached to them.

1 Like