Parcourir la source

LibCore: Don't auto-accept events that hit bubbling limit

We were using the "accept" flag on the event to break out of the
bubbling loop, but this had lasting consequences since all events that
bubbled too far came out looking as if someone had accepted them.

If an event is ignored by everyone, it should appear ignored.
Andreas Kling il y a 4 ans
Parent
commit
dbd090fd95
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      Libraries/LibCore/Object.cpp

+ 1 - 2
Libraries/LibCore/Object.cpp

@@ -231,8 +231,7 @@ void Object::dispatch_event(Core::Event& e, Object* stay_within)
         target = target->parent();
         if (target == stay_within) {
             // Prevent the event from bubbling any further.
-            e.accept();
-            break;
+            return;
         }
     } while (target && !e.is_accepted());
 }