A simple modern solution/hack that I've used is adding a (tap) event to the background layer. The whole layer effectively becomes a button, and you can no longer interact with anything behind it. I then send the tap event to an empty function.