From 1a63a7054f2bdc64c750f15cb3a2029dd0183f72 Mon Sep 17 00:00:00 2001
From: Gabriel Tofvesson <gabriel@tofvesson.se>
Date: Sat, 12 Oct 2024 00:41:26 +0200
Subject: [PATCH] Handle events in children before parents

---
 gfx/prop/children.lua | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/gfx/prop/children.lua b/gfx/prop/children.lua
index 2deaa13..256de07 100644
--- a/gfx/prop/children.lua
+++ b/gfx/prop/children.lua
@@ -122,10 +122,6 @@ function Children:with(elementType)
   end
 
   function elementType:handleEvent(evt)
-    if Element.handleEvent(self, evt) then
-      return true
-    end
-
     local evtLocalCoords = Event.toElementLocalPosition(evt, self)
 
     if Event.isClickEvent(evt) then
@@ -139,15 +135,15 @@ function Children:with(elementType)
           return true
         end
       end
-      return false
     else
       for _,child in self:_iterateChildren() do
         if child:handleEvent(evtLocalCoords) then
           return true
         end
       end
-      return false
     end
+
+    return Element.handleEvent(self, evt)
   end
 
   return elementType