# Regression: edit reason input not autofocussed

**URL:** https://meta.discourse.org/t/regression-edit-reason-input-not-autofocussed/64779
**Category:** Bug
**Created:** [June 20, 2017, 2:08am UTC](https://meta.discourse.org/t/regression-edit-reason-input-not-autofocussed/64779 "2017-06-20T02:08:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![barryvan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barryvan/32/82635_2.png) [@barryvan](https://meta.discourse.org/u/barryvan)
#### Post date: [June 20, 2017, 2:08am UTC](https://meta.discourse.org/t/regression-edit-reason-input-not-autofocussed/64779/1 "2017-06-20T02:08:46Z")

</div>

> [@When editing, click on "add edit reason" should focus on input](https://meta.discourse.org/t/when-editing-click-on-add-edit-reason-should-focus-on-input/46348):
>
> I always add a reason when I edit a post, and it takes one extra click to do it. If a user clicks the “add edit reason” link, you can safely assume they will immediately be typing in the edit reason, so the input field should immediately get focus for input.

> [@Pressing "Add edit reason" button does not auto-focus into the text field](https://meta.discourse.org/t/pressing-add-edit-reason-button-does-not-auto-focus-into-the-text-field/39140/8):
>
> Not really a bug… but fixed none the less slight_smile[https://github.com/discourse/discourse/commit/3ad1423c5390595cdf80242815d6e43412a12ae7](https://github.com/discourse/discourse/commit/3ad1423c5390595cdf80242815d6e43412a12ae7)

It looks to me as though @sam’s fix for this has regressed; in Firefox, when I click “add edit reason”, the `input` isn’t focussed automatically.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 12, 2018, 10:02pm UTC](https://meta.discourse.org/t/regression-edit-reason-input-not-autofocussed/64779/2 "2018-06-12T22:02:12Z")

</div>

Yeah this regressed.. @j.jaffeux can you take a look? Clicking add edit reason should definitely trigger focus, because we already clicked / tapped..

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [June 13, 2018, 8:32am UTC](https://meta.discourse.org/t/regression-edit-reason-input-not-autofocussed/64779/4 "2018-06-13T08:32:45Z")

</div>

I’m not actually sure it “regressed” as in the code didn’t change, we still have autofocus on the input and it’s still working for me “the first time” but not on the second time.

I just pushed a commit which will make this kind of behaviour much more reliable:

[https://github.com/discourse/discourse/commit/4e0c06a0b16acaf88c3899f829636ac0f1a254a9](https://github.com/discourse/discourse/commit/4e0c06a0b16acaf88c3899f829636ac0f1a254a9)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [June 13, 2018, 8:32am UTC](https://meta.discourse.org/t/regression-edit-reason-input-not-autofocussed/64779/5 "2018-06-13T08:32:48Z")

</div>


