In my application, ListViews (UIToolkit runtime 2021.2.0b10) scroll extremely slowly with the mousewheel. I’m not finding a way how to adjust the speed of the scrolling.
According to the documentation, ScrollViews have the “VerticalPageSize” attribute that is supposed to control exactly that, but this parameter is not available in ListViews.
Nevertheless, even changing VerticalPageSize in ScrollViews doesn’t have any effect on the scrolling speed either.
Am I missing something, or is it “a work in progress”-topic?
It seems to work with 2021.2.0b6 so it must be a recent regression. I reported the case (#1364827) and will post the link to it when it becomes available (will take a few days).
I guess you mean here the VerticalPageSize parameter of the ScrollView. That is one issue. Thanks for filing a bug report.
The other issue is the slow scrolling of ListViews. Can you please confirm that I’m not missing something when I don’t find a way to change the scroll speed of ListViews?
I investigated with the team and here’s the answer I got:
We’ve had a regression on scrolling recently caused by changes to page size, and basically realized that scrolling should not depend on page size. It should always scroll the same amount regardless of the size of the viewport/content. So now we depend on line height. Users can override --unity-metrics-single_line-height in uss on their ScrollView/ListView to change the sensitivity. Default is 18px.
Also, in the future we’ll make single line height adjustable from the code as well.
But on 2021.2.0b15 the workaround seams not to change anything.
No matter what value I set --unity-metrics-single_line-height to, the scroll-speed does not change.
Setting --unity-metrics-single_line-height used to work with 2021.2.0b10 but as others reported, it stopped working with later versions. With 2021.2.11f1 still no luck.
Before 2021.2.0b15 it used to be enough to set the key --unity-metrics-single_line-height on the root visual element. In later Unity versions, the key must be applied to the parent of the root visual item, which is in my case (runtime) the Panel Settings (check it in the Toolkit Debugger).
I didn’t find a way to do this in the UI Builder directly, so I add my stylesheet also to the parent per script on startup:
StyleSheet styleSheet = Resources.Load<StyleSheet>("UI/UI-Main");
if (styleSheet != null)
root.parent.styleSheets.Add(styleSheet);
where root is uiDocument.rootVisualElement.
Now, :root {
–unity-metrics-single_line-height: 500px;
} in the stylesheet is applied correctly.
2021.2.7f1 here and this doesn’t work for us (using rootVisualElement or rootVisualElement.parent of runtime UI Document). Our setup has two UI Documents if that makes any difference. Would really appreciate some input from the team on how to make this usable - I had hoped it would be fixed by now - it’s an incredibly painful issue.