# Text Editor Focus Problem

**URL:** <https://forum.juce.com/t/text-editor-focus-problem/17123>\
**Category:** General JUCE discussion\
**Created:** [April 7, 2016, 10:04pm UTC](https://forum.juce.com/t/text-editor-focus-problem/17123 "2016-04-07T22:04:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahbee](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Ahbee](https://forum.juce.com/u/Ahbee)\
**Post date:** [April 7, 2016, 10:04pm UTC](https://forum.juce.com/t/text-editor-focus-problem/17123/1 "2016-04-07T22:04:25Z")

</div>

It seems JUCE gives focus to the first child that wants focus no matter where you click in a component. I created a custom component which consists of label and a textEditor. I add these components to a larger parent component. The problem is every time I click on the label part of the custom component the textEditor becomes focused. I want it such that the textEditor only takes focus if you click on it. If I click anywhere else in the component it should not focus. Thanks

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 8, 2016, 8:46am UTC](https://forum.juce.com/t/text-editor-focus-problem/17123/2 "2016-04-08T08:46:50Z")

</div>

No, it’s way more complicated and flexible than that! If you look at the Component class and search for “focus” you’ll find a ton of methods for customising what happens in many different ways.
