Scroll position resets when using slider dragger in 2022.1

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.

5 Likes

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.

Found no workaround so far.

1 Like

I think we may be seeing symptoms of the same behavior:

This bug is forcing us to downgrade our project to Unity 2021.3, because all scrollbars exhibit this behavior. To reproduce:

  1. Place any input such as a slider, an input field or a button inside a scroll view.
  2. Run the project.
  3. Scroll down.
  4. 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?

I can confirm it as well.

@pawelduda , could you please share bug report reference, so we could follow it?

Sadly I didn’t receive one yet. As soon as Unity provide me with one, I will post it here.

1 Like

That is because I reported it a while ago :smile:

https://issuetracker.unity3d.com/issues/textfield-scrolls-up-when-highlighting-text-at-the-bottom-of-the-textfield

Please, please say you found a workaround?

No I am stuck on 2022.1.6 because of this bug.

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
1 Like

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.

@HugoBD-Unity @benoitd_unity Is there any progress on backporting those fixes to 2022.1?

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.

1 Like

@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.

@HugoBD-Unity @benoitd_unity
We have the same problem. This bug is a major blocker for our progress.

Here is the official issue tracker linkt to the bug:

The fixes for the issues mentioned above have landed in 2023.1. So far, they have been backported to 2022.2 and 2022.1 and they should land shortly.

@oobartez

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?

@FaithlessOne UUM-10441 is a different issue that won’t be backported with the above fixes. The bug is fixed and is in the process of being backported

Hi @HugoBD-Unity , any idea when that specific bug with sliders will be fixed and backported?