# Prevent TextField from losing focus

**URL:** <https://forum.kirupa.com/t/prevent-textfield-from-losing-focus/316874>\
**Category:** Uncategorized\
**Created:** [December 4, 2010, 11:05pm UTC](https://forum.kirupa.com/t/prevent-textfield-from-losing-focus/316874 "2010-12-04T23:05:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geki](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@Geki](https://forum.kirupa.com/u/Geki)\
**Post date:** [December 4, 2010, 11:05pm UTC](https://forum.kirupa.com/t/prevent-textfield-from-losing-focus/316874/1 "2010-12-04T23:05:16Z")

</div>

Hey,

I have a button that clears the entire TextField but clicking the button makes me lose focus from the TextField.  
Right now I’m just putting the focus back with stage.focus = textField; as the event occurs.

Is it possible to somehow not lose focus from a TextField when pressing a button?
