I have a NodeView
which renders an input field. The behavior I want to implement is this: if the current selection is a NodeSelection
of a node of this particular type, and the user presses Enter, then the input field of that node should receive keyboard focus.
I’ve figured out the first half but got stuck trying to invoke .focus()
inside the NodeView
since I can’t see a way of getting from a node (or document range corresponding to a node) to its corresponding NodeView.
I’ve thought of making an attribute like hasFocus
and sending a node update with that attribute set to true
but this seems brittle and not what attributes are probably meant for.