# Blur focus of button

**URL:** <https://forum.inductiveautomation.com/t/blur-focus-of-button/40320>\
**Category:** Ignition\
**Created:** [November 4, 2020, 11:38pm UTC](https://forum.inductiveautomation.com/t/blur-focus-of-button/40320 "2020-11-04T23:38:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [November 4, 2020, 11:38pm UTC](https://forum.inductiveautomation.com/t/blur-focus-of-button/40320/1 "2020-11-04T23:38:13Z")

</div>

How do you blur the focus of a button after it is clicked in perspective? I have tried self.blur() at the end of action performed but the button still looks selected after clicking it. I want to return focus back to a text field in another embedded view but it seems that it will not happen if the button still looks selected.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [November 6, 2020, 7:07pm UTC](https://forum.inductiveautomation.com/t/blur-focus-of-button/40320/2 "2020-11-06T19:07:38Z")

</div>

The button having focus was a red herring. The actual issue is that a modal pops up and displays loading and then is closed programmically. So the issue appears to be the focus does not return to the text field after close popup is called. After I close the popup modal I can call self.focus() and the code that returns the cursor to the TextField works.

---

<div class="post-metadata">

**Author:** ![rbachman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbachman/32/43718_2.png) [@rbachman](https://forum.inductiveautomation.com/u/rbachman)\
**Post date:** [December 18, 2020, 4:14pm UTC](https://forum.inductiveautomation.com/t/blur-focus-of-button/40320/3 "2020-12-18T16:14:31Z")

</div>

Where did you put the **self.focus()** call? Was it on the text box? Or the button? Or the view?

I am trying to give focus to a specific text box after closing a modal popup, and it sounds like I may need a similar solution.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [December 18, 2020, 10:21pm UTC](https://forum.inductiveautomation.com/t/blur-focus-of-button/40320/4 "2020-12-18T22:21:57Z")

</div>

Use a message handler

---

<div class="post-metadata">

**Author:** ![rbachman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbachman/32/43718_2.png) [@rbachman](https://forum.inductiveautomation.com/u/rbachman)\
**Post date:** [December 21, 2020, 3:52pm UTC](https://forum.inductiveautomation.com/t/blur-focus-of-button/40320/5 "2020-12-21T15:52:34Z")

</div>

That was exactly what I needed. Thanks!
