# Foreground button click being intercepted by background button

**URL:** <https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298>\
**Category:** How-to Discussions\
**Created:** [October 6, 2016, 2:12am UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298 "2016-10-06T02:12:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mthomson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/mthomson/32/174_2.png) [@mthomson](https://forums.fusetools.com/u/mthomson)\
**Post date:** [October 6, 2016, 2:12am UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298/1 "2016-10-06T02:12:22Z")

</div>

Using Fuse Example OverLay-Menu as a basis, when the popover menu appears covering the main view, if I click on one of the overlayed buttons, the click is intercepted by a button on the Main screen which is in the background. I tried adding args.stopPropagation to the button function, but it never seems to get triggered. It’s always intercepted by the background button, rather than the foreground button. Is there a way to tell the background to stop responding to events while the overlay menu is active in the foreground?

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [October 6, 2016, 7:47am UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298/2 "2016-10-06T07:47:09Z")

</div>

Do any of these threads answer your question?  
[https://www.fusetools.com/community/forums/howto\_discussions/fusetools\_example\_-](https://www.fusetools.com/community/forums/howto_discussions/fusetools_example_-)_overlay\_menu_-\_how\_to\_enable\_n  
[https://www.fusetools.com/community/forums/howto\_discussions/how\_to\_add\_events\_to\_the\_overlay\_menu\_buttons](https://www.fusetools.com/community/forums/howto_discussions/how_to_add_events_to_the_overlay_menu_buttons)

---

<div class="post-metadata">

**Author:** ![mthomson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/mthomson/32/174_2.png) [@mthomson](https://forums.fusetools.com/u/mthomson)\
**Post date:** [October 6, 2016, 12:26pm UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298/3 "2016-10-06T12:26:55Z")

</div>

Thanks Remi! That looks like it might be what I was looking for. I’ll try it out. 😃

---

<div class="post-metadata">

**Author:** ![mthomson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/mthomson/32/174_2.png) [@mthomson](https://forums.fusetools.com/u/mthomson)\
**Post date:** [October 18, 2016, 3:36am UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298/4 "2016-10-18T03:36:24Z")

</div>

I worked through the solutions that Remi posted, and I got the buttons working now so that was good. But I’m finding now, that after I clicked the buttons on the popup panel, and the panel closes, that the front panel no longer accepts any clicks?

Any ideas why?

- [Attached ZIP file](https://s3.us-east-2.amazonaws.com/fuse-legacy-forum-assets/oZEBe9lfOKGQ-image-1476761569228.zip)

---

<div class="post-metadata">

**Author:** ![Bent](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/bent/32/157_2.png) [@Bent](https://forums.fusetools.com/u/Bent)\
**Post date:** [October 18, 2016, 7:55am UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298/5 "2016-10-18T07:55:48Z")

</div>

I haven’t looked at the source, but it sounds like it might be related to focus or perhaps HitTestMode. [https://www.fusetools.com/docs/fuse/elements/hittestmode](https://www.fusetools.com/docs/fuse/elements/hittestmode)

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [October 18, 2016, 12:09pm UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298/6 "2016-10-18T12:09:36Z")

</div>

The culprit is the rectangle called `addTaskButtons` and its somewhat unexpected behavior when its color is changing.

I believe this is what happens:

- At first it has no color at all, which means it doesn’t get hit-tested
- When you pop up the button panel the first time it gets assigned a color, which is faded to “#000d”.
- When you exit the button panel that color is faded down to “#0000” (black with zero opacity being its default), but since it now _has_ a color it is still hit-tested and effectively blocking all other interactions.

The simplest solution is to just put a `HitTestMode="None"` in that rectangle. However, given that you _also_ have `otherPanel` for the same purpose (== hiding the calendar) you might be able to get rid of `addTaskButtons` altogether?

---

<div class="post-metadata">

**Author:** ![mthomson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/mthomson/32/174_2.png) [@mthomson](https://forums.fusetools.com/u/mthomson)\
**Post date:** [October 19, 2016, 12:42am UTC](https://forums.fusetools.com/t/foreground-button-click-being-intercepted-by-background-button/6298/7 "2016-10-19T00:42:10Z")

</div>

Yeh removing the addTaskButtons rectangle worked. Thanks.
