patch

Before it would only check the event target now it checks everything between the target and the event handler. The test demonstrates the use case