TreeViewItem itemClicked() called when scrolling

I am using a TreeView on iOS. When a leaf (TreeViewItem) is tapped, I want the app to play a sound. This works well. But I don’t want it to play a sound when the user starts scrolling the tree. However, itemClicked() or itemSelectionChanged() is being called as soon as the user touches the tree (even for a scroll). How do I prevent this from happening?

Play on mouse up would probably solve this.

Although there are no such events on a TreeViewItem, you’d still don’t want to play on an up event when the user was scrolling.

I assumed you were using a custom component, for which you could then also take care of the functionality not to play (ie a simple local bool) when a drag is used. Which would be my suggestion :slight_smile:

No, so I ended up modifying the TreeViewItem source code not to call itemClicked() in mouseDown and only call it in mouseUp when dragging was false.