we have situations where we want to hide nodes under certain circumstances. They should continue to be part of the document, and their contents should not be lost, but they should not be shown (temporarily).
What has worked well in the past is to simply add an attribute (hidden) and then use CSS declaration of
display: none; to make sure those nodes are not shown.
This still works in most situations, but I recently noticed that sometimes the caret is being moved so it ends up in a node that is currently hidden when using the arrow-keys. I assume this is when ProseMirror is overriding what the browser would do. Currently I am thinking that the easiest will likely be to create a plugin that checks for selection changes and in those cases where the selection ends up in a node that should be hidden, it simply moves the caret further in whatever direction it was going until it ends up in a not-hidden node.
Or does anyone here have other good ideas?