# Trigger event on discarding keyboard

**URL:** <https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079>\
**Category:** How-to Discussions\
**Created:** [April 23, 2018, 6:50am UTC](https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079 "2018-04-23T06:50:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matti\_Tihverainen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/matti_tihverainen/32/684_2.png) [@Matti\_Tihverainen](https://forums.fusetools.com/u/Matti_Tihverainen)\
**Post date:** [April 23, 2018, 6:50am UTC](https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079/1 "2018-04-23T06:50:18Z")

</div>

In the following example the TextInput’s Background changes when focused. However when I tap the down arrow (left button on the bottom menu) on the Android keyboard and the keyboard discards, the TextInput stays in focus. How can I lose focus of the TextInput when discarding the keyboard?

```
<App>
  <TextInput ux:Name="TextInput" Width="100%" Height="50" Background="#0000ff">
    <WhileFocused>
      <Set TextInput.Background="#ff0000" />
    </WhileFocused>
    <WhileNotFocused>
      <Set TextInput.Background="#0000ff" />
    </WhileNotFocused>
  </TextInput>
</App>
```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 23, 2018, 1:06pm UTC](https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079/2 "2018-04-23T13:06:36Z")

</div>

Use [ReleaseFocus](https://docs.fusetools.com/fuse/triggers/actions/releasefocus.html).

---

<div class="post-metadata">

**Author:** ![Matti\_Tihverainen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/matti_tihverainen/32/684_2.png) [@Matti\_Tihverainen](https://forums.fusetools.com/u/Matti_Tihverainen)\
**Post date:** [April 23, 2018, 1:28pm UTC](https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079/3 "2018-04-23T13:28:50Z")

</div>

Thanks for the suggestion! However TextInputActionTriggered doesn’t fire when the keyboard is discarded by pressing the bottom left button. It only fires when the TextInput is submitted (pressing “next”).

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 23, 2018, 1:36pm UTC](https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079/4 "2018-04-23T13:36:18Z")

</div>

Well there’s always [WhileKeyboardVisible](https://docs.fusetools.com/fuse/triggers/whilekeyboardvisible.html), which conveniently comes with an `Invert` property too, just like the other `While*`-triggers.

---

<div class="post-metadata">

**Author:** ![Matti\_Tihverainen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/matti_tihverainen/32/684_2.png) [@Matti\_Tihverainen](https://forums.fusetools.com/u/Matti_Tihverainen)\
**Post date:** [April 23, 2018, 7:36pm UTC](https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079/5 "2018-04-23T19:36:53Z")

</div>

Thanks Uldis! Works great!

---

<div class="post-metadata">

**Author:** ![maulikshah](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/maulikshah/32/681_2.png) [@maulikshah](https://forums.fusetools.com/u/maulikshah)\
**Post date:** [April 24, 2018, 1:26pm UTC](https://forums.fusetools.com/t/trigger-event-on-discarding-keyboard/7079/6 "2018-04-24T13:26:37Z")

</div>

Thanks a lot for this wonderful communication. As I got to learn a lot and got all my queries solved over from here.
