# Pressing "Add edit reason" button does not auto-focus into the text field

**URL:** <https://meta.discourse.org/t/pressing-add-edit-reason-button-does-not-auto-focus-into-the-text-field/39140>\
**Category:** Bug\
**Created:** [6 Febrero, 2016 09:17 UTC](https://meta.discourse.org/t/pressing-add-edit-reason-button-does-not-auto-focus-into-the-text-field/39140 "2016-02-06T09:17:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GaurangTandon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gaurangtandon/32/52384_2.png) [@GaurangTandon](https://meta.discourse.org/u/GaurangTandon)\
**Post date:** [23 Marzo, 2016 09:46 UTC](https://meta.discourse.org/t/pressing-add-edit-reason-button-does-not-auto-focus-into-the-text-field/39140/2 "2016-03-23T09:46:42Z")

</div>

Solution found. In this file:

> <https://github.com/discourse/discourse/blob/eb5cee3150fbd0b2de08d2a93b3959a20e41a691/app/assets/javascripts/discourse/controllers/composer.js.es6>

Line 173+ need to be something like this:

```
displayEditReason() {
  this.set("showEditReason", true);
  # a way to get input#edit-reason and call .focus() on it
},

```

I don’t know how to interact with DOM in this file, is it simply `document.querySelector()`? If someone can tell me this, I will submit a PR with fixes 🙂

---

_[View the full topic](https://meta.discourse.org/t/pressing-add-edit-reason-button-does-not-auto-focus-into-the-text-field/39140)._
