# CLOSED - Question regarding editor.focus();

**URL:** https://discuss.codemirror.net/t/closed-question-regarding-editor-focus/544
**Category:** Uncategorized
**Created:** [November 20, 2015, 9:32pm UTC](https://discuss.codemirror.net/t/closed-question-regarding-editor-focus/544 "2015-11-20T21:32:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![peterkroon](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/peterkroon/32/5_2.png) [@peterkroon](https://discuss.codemirror.net/u/peterkroon)
#### Post date: [November 20, 2015, 9:32pm UTC](https://discuss.codemirror.net/t/closed-question-regarding-editor-focus/544/1 "2015-11-20T21:32:26Z")

</div>

The docs mention:

> cm.focus()  
> Give the editor focus.

When I go to [http://codemirror.net/](http://codemirror.net/) and open the webconsole and execute `editor.focus();` the cursor does not blink in the editor. Is this the correct behaviour?

---

<div class="post-metadata">

### Author: ![peterkroon](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/peterkroon/32/5_2.png) [@peterkroon](https://discuss.codemirror.net/u/peterkroon)
#### Post date: [November 20, 2015, 9:44pm UTC](https://discuss.codemirror.net/t/closed-question-regarding-editor-focus/544/2 "2015-11-20T21:44:27Z")

</div>

I’ve played with this a bit more and added a listener  
`editor.on("focus", function(){console.log("hi, focus..");});`

When executing `editor.focus();` the editor does not get focus. When the cursor is placed in the editor via mouse the listener is executed. I’ll report this as a bug on [GitHub](https://github.com/codemirror/CodeMirror/issues/3656).
