# Passing scroll events from child repeater to parent canvas

**URL:** <https://forum.inductiveautomation.com/t/passing-scroll-events-from-child-repeater-to-parent-canvas/94282>\
**Category:** Ignition\
**Tags:** scripting, vision\
**Created:** [August 7, 2024, 9:31am UTC](https://forum.inductiveautomation.com/t/passing-scroll-events-from-child-repeater-to-parent-canvas/94282 "2024-08-07T09:31:55Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [August 7, 2024, 2:24pm UTC](https://forum.inductiveautomation.com/t/passing-scroll-events-from-child-repeater-to-parent-canvas/94282/7 "2024-08-07T14:24:21Z")

</div>

To play around with this, I set up a template canvas where one of the templates had a template repeater that didn't need scrolling. This script produced the desired result from the nested _ **template repeater's** _ propertyChange event handler:

```python
# Written for the propertyChange event handler of the TEMPLATE REPEATER
# Won't run in designer unless preview mode is on prior to opening the window
if event.propertyName == 'componentRunning':
	
	# Nested function that gets all components of a given class within a given container
	# Recommend relocating this to a library script because it is quite handy
	def getAllComponentsOfClass(container, className):
		foundComponents = []
		for component in container.components:
			if component. __class__. __name__ == className:
				foundComponents.append(component)
			else:
				foundComponents.extend(getAllComponentsOfClass(component, 'JideScrollPane'))
		return foundComponents
	
	# Get all of the JideScrollPanes in the source repeater
	scrollPanes = getAllComponentsOfClass(event.source, 'JideScrollPane')
	
	# Iterate through the scroll panes and remove all mouse listeners and mouse wheel listeners,
	# ...so a parent canvas's scroll wheel event is not consumed by these inner components
	for scrollPane in scrollPanes:
		for listener in scrollPane.mouseWheelListeners:
			scrollPane.removeMouseWheelListener(listener)
		for listener in scrollPane.mouseListeners:
			scrollPane.remove(listener)

```

At initialization, it simply locates all of the JideScrollPanes within a given repeater and removes the listeners that can consume a mouse wheel event.

---

_[View the full topic](https://forum.inductiveautomation.com/t/passing-scroll-events-from-child-repeater-to-parent-canvas/94282)._
