View.focus but but not has cursor in content

what i expected is view.focus() can has a cursor in content however, focus not has cursor but seems already worked. in browser continuely ctrl-v my Slice, new Slice do added instead of replace last added slice after call view.focus in nodeview, but do not show a expected blinking cursor at the end of the new slice

am i missing something from the manual ?

what i do is

if (isPaste) {
      const selection = Selection.atEnd(view.docView.node)
      const tr = view.state.tr.setSelection(selection, 1).scrollIntoView()
      const state = view.state.apply(tr)
      view.updateState(state)
    }

view.docView isn’t part of the public interface, so just use view.state.doc instead. setSelection doesn’t have a second argument. And the last two lines can be replaced by simply view.dispatch(tr).

But none of those seem like they are the problem. Where are you calling this code? And could you describe what goes wrong more clearly, since I don’t see the connection between focus and the code you are showing.