A way to use an EventHandler but not have it intercept everything?

Short version: I have a ScrollRect that has a bunch of UI bars in it that form a list you can scroll through.

Updating the code, I wanted to make it so you could swipe left on a bar to delete it, similar to how message and email apps work on mobile devices.

When I added the EventHandler to manage the left swipe, the scroll doesn’t work any longer. When I added the event handler to the individual bars themselves, the scroll only works if it starts between the bars.

Is there a way to make this work, without having to completely write my own scroll rect controller from the event handler?

Clicks still work through the event handler. Just not the scrollrect in the parent. EDIT: Clicks work through it because I implemented a custom button override that detects long-presses/clicks, so thats working through IPointerClick. May need to implement my own swipe class that uses similar methods…?

EDIT 2: Just found IDragHandler. Still interested in if the EventHandler system can do this as that seems easier…?

EDIT 3: Using IDragHandler intercepts the drag event as well. Just realized that the EventHandler component is just an easier frontend to the Interfaces?

Pseudo-layout of how it’s set up:

--ScrollRect
----Viewport with a Vertical Layout Group
------Info Bar with an EventHandler to handle the swipe
------Info Bar with an EventHandler to handle the swipe
------Info Bar with an EventHandler to handle the swipe

Just let your items intercept the events.
Then, evaluate the event data at the very beginning of any drag-action. A trivial approach to decide whether to swipe or scroll is to check whether there’s a significant up-movement. In that case, set a “not swiping to the side” flag for the current action and keep forwarding the event to the next scroll handler (let it “bubble up”). You can reset it when the direction significantly changes, or when dragging ends.

But thats exactly the problem… they DONT intercept the events. As soon as I add the event handler, or the IDragHandler interface, the scroll rect completely stops responding to up/down drag events. Thats my question… I WANT to do what you answered. I can’t. The event handler stops the other events from intercepting.

That’s desired.
Suppose everything responded to the event, there’d be alot of ambigious inputs that you would need to re-direct manually, because most of the time, you only want to have one element that reacts to a given input event.
So Unity has decided it’s going to be the handler that’s on the object rendered on top (which is - by default - based on the object hierarchy), because that’s the expected behaviour in nearly all cases.

And here you go… there’s a drag handler (the scroll rect) and “on top of it” there are draggable items (because they’re children of the scrollrect->view port->content). That’s why the draggable items receive the event, and so that’s the place where you need to make the decision: measure the y-delta and determine whether that’s still considered a swipe-input.
If it’s rather a drag input for the scroll rect, ignore the logic for swiping and forward the event.

Thanks for the info. Using this and some google searching, I’m having the DragHandler check the delta of the drag, and if it’s vertical, it passes the drag along to the parent ScrollRect. Currently working on making it pass the button clicks through also. Thanks for the explanation as to why.