Unity 2022.1 has a bug that resets ScrollView position. To reproduce this issue place a Slider inside a ScrollView in a position, that requires scrolling down. When sliders dragger is used to change slider value, ScrollView scroll position resets. This is really annoying.
I’ve submitted a bug report, but does anyone know a workaround for this issue? Maybe there is a simple fix.
I also came across this bug today. It is clearly reproducable in Unity 2021.3.6.
In my project it also occurs in other situations for example sometimes when clicking buttons (but not always) or always when draging/moving VisualElements.
This bug is forcing us to downgrade our project to Unity 2021.3, because all scrollbars exhibit this behavior. To reproduce:
Place any input such as a slider, an input field or a button inside a scroll view.
Run the project.
Scroll down.
Click and drag any of the elements in the scroll view.
As a result the scroll will jump up to zero.
What it means in practice is that for example in our game settings panel, when someone scrolls down to volume controls and drags a volume slider, the settings panel scrolls up. So the settings panel is currently unusable.
@benoitd_unity This appears to be a critical bug. Is there any chance you would be able to release a hotfix soon?
Hi all! We are deeply sorry for the trouble this caused. We have a PR that contains fixes for the aforementioned bugs and more and it will be backported to 2022.1. We are actively working on it so it can land in the shortest amount of time.
Here are some of the fixes contained in the PR:
Fix vertical scroll bar not working with text fields
UUM-8427: TextField scrolls up when highlighting text at the bottom of the TextField
Fix shift+tab not working on Mac
Fix last character of wrapped line not selected in text field
Fix caret in disappearing depending on Reference DPI
This major bug is still reproducable in the latest Unity LTS release 2021.3.9. I created a bug report. Sadly it seems this bug has to be reported for every Unity version separately to get fixed.
Our game is stuck on Unity 2022.1.6 and we haven’t been able to upgrade since June because the scroll bug makes all of UI Toolkit unusable in any of the newer versions. Because of that we are also stuck with multiple other bugs that were already fixed in July and August.
For the record, the bug does not apply only to text fields. It also affects other elements, for example sliders. So in practice any game that uses UI Toolkit and scrollbars is unable to upgrade beyond 2022.1.6.
@HugoBD-Unity
Is there any chance this bug will be fixed soon - seems to be quite a critical one?
It blocks us from migrating to any newer version of Unity (we’re stuck at 2021.1.6), because it breaks essential UI interaction and makes the game unplayable.
As far as I know, the issues fixed and being backported are specific to the TextField. It could be a different issue. Could you report a bug and report back the case number?