how to auto focus when the editor loaded

cause some special need,there are two question
q1:how to auto focus when the editor loaded
q1:the editor how to stay focused when click outside of the editor
thx!!!

You can call EditorView.focus to focus it. There’s no autofocus feature. Keeping focus when the user clicks outside of the editor sounds like a rather bad idea and is likely to annoy users, but I suppose you could listen to blur events and refocus.