NodeView affects posAtCoords

Continuing the discussion from Drag'n'Drop - a drag handle element:

I used MyNodeView for code block node. Everything works as expected, until I add a plugin which contains:

                    handleDrop: (view, event, slice) => {
                            const posAtCoords = view.posAtCoords({
                                left: event.clientX,
                                top: event.clientY,

                          if (!posAtCoords) return false
                          //// this is problematic as the `pos` depends on how many nodeviews before 
                          const node = view.state.doc.resolve(posAtCoords.pos)

Given a code block node at the beginning of the editor, if you drag and drop some node before the code block node, it prints 1 with MyNodeView and 0 without MyNodeView.

I am not sure if I am using the pos wrong, but I want to get the right node where drop happens with/without MyNodeView.

Node views can affect the size and geometry of nodes, so the fact that it is possible to change the output of posAtCoords this way does not surprise me.

Well, then can I resolve to the right node any way?

I also find that if I add into MyNodeView

this.dom.contentEditable = false
this.contentDOM.contentEditable = true

I can get the right pos. But the editing behavior in the node becomes weird.