NodeSpec (with atom: true and content: inline*) and focus

Have a nice day to everyone!

I have an element in the editor, in the NodeSpec of which I have:

group: block
content: inline*
atom: true

My problem is that I definitely need to have atom:true because I need access to the selectNode and deselectNode methods in the NodeView, but in this case, when focusing, my element is fully selected, but I need to put the cursor in an inline element to enter text.

How do I change the selection when focusing?

I tried to define the setSelection method in the NodeView, but something didn’t work out for me… I don’t understand what I should do in this method.

And I tried to create a Transaction in the selectNode and specify the Selection, but I also didn’t get the result I needed.

Thank you for your time! :upside_down_face:

If you want the node’s content to be editable, you definitely need to have that to false.

I don’t quite understand what you’re saying about selectNode/deselectNode. Those also work for non-atom nodes. Just that those can’t be selected by clicking them (because clicking them already has a meaning—putting the cursor inside of them). So you’d have to provide some alternative way for the user to select them.

1 Like

Thank you!