How to make auto focus editor


#1

How to make a auto focus editor?

@subview 'cmdEditor', new EditorView(mini: true, placeholderText: 'input your command here')

It is not focus after created. I want to auto focus it. How can I do it?


#2

This should work.

@cmdEditor.focus()

You can see this repo as an example.

https://github.com/atom/go-to-line/blob/master/lib/go-to-line-view.coffee#L67


#3

Thank you very much, it works