How to Restrict Text Selection to a Specific Node in ProseMirror?

I need to restrict the text selection such that users cannot select outside a specific node (for example, a div with a specific class like restricted).

You could filter out transactions that move the selection out of the node.

2 Likes