Scroller Synchronization

I have 4 ListViews and I want to synchronize their scroller, each list has the same number of elements.
I have more than 30.000 elements in each lists.

Here is an example of what the code looks like :

verticalScroller1.valueChanged += delegate {Synchronize(verticalScroller1.value)}
verticalScroller2.valueChanged += delegate {Synchronize(verticalScroller2.value)}
verticalScroller3.valueChanged += delegate {Synchronize(verticalScroller3.value)}
verticalScroller4.valueChanged += delegate {Synchronize(verticalScroller4.value)}

Synchronize(value)
{
verticalScroller1.value = value
verticalScroller2.value = value
verticalScroller3.value = value
verticalScroller4.value = value
Debug.log(scroller4.value) // scroller4.value = scroller4.highValue, scroller4.value != scroller1.value
}

When scrolling with the scroller1 bar (not using the mouse wheel), the highValues of the other scrollers sometimes won’t update correctly near the bottom of the scrollbar, and only the first listView will have a normal “scrolling behavior”.

Hope I made myself clear enough as I am not authorized to share code.

I guess my only solution is to merge the listViews into one and use columns, could someone confirm this ?

Hi! Have you tried using ScrollView.scrollOffset instead? Also, you might want to avoid setting the same value multiple times. When the value of the first scroll changes that triggers a value changes in your other scrolls and those value changes also trigger more value changes again, so that could be one of the problems.

Also, you can take a look at MultiColumnListView and see if it suits better your use case: Unity - Scripting API: MultiColumnListView

Hi, the resullt is the same with ScrollView.scrollOffset. Yeah I’ll admit the valueChanged events might be the problem + it hurts my eyes, but how else could I synchronize each values from every scroller ?

This is a small weird bug and I’ll turn this into a MultiColumnListView which will surely save me some time.

Still I’m curious if someone could reproduce this bug and maybe patch it if it is truly a Unity bug.

Thank you for the response and have a good day !