# Focus the editor when title is pre-filled

**URL:** <https://meta.discourse.org/t/focus-the-editor-when-title-is-pre-filled/311449>\
**Category:** Development\
**Created:** [June 10, 2024, 9:10pm UTC](https://meta.discourse.org/t/focus-the-editor-when-title-is-pre-filled/311449 "2024-06-10T21:10:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [June 10, 2024, 10:23pm UTC](https://meta.discourse.org/t/focus-the-editor-when-title-is-pre-filled/311449/2 "2024-06-10T22:23:15Z")

</div>

I think this is what you’re looking for:

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/composer-editor.js#L159-L164](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/composer-editor.js#L159-L164)

Every time the `focusTarget` value changes, this `setFocus` function is called.

---

_[View the full topic](https://meta.discourse.org/t/focus-the-editor-when-title-is-pre-filled/311449)._
