Blocking bug: Carets not working in 2022.1

Unity 2022.1 has a bug in text fields which causes carets not to be visible on some resolutions and UI scales / DPI resolutions. To reproduce the problem, place a UI Toolkit text field and start the game in different resolutions and UI scales - the caret is visible on some configurations but not others.

Does anyone know a workaround? This is preventing us from updating to 2022.1, we cannot ship a game with invisible carets.

There is an issue in the bug tracker:

Not sure if it is the same issue though.

We tested it on Windows and macOS, Unity 2022.1.8f1.

2 Likes

Hi @oobartez !

It’s a known bug and a high-priority one. We will look into it shortly. l’ll need to investigate further to see if there’s a workaround. I’ll keep you posted.

@HugoBD-Unity Thank you for confirming that it’s being worked on! Let me know if you need any additional information from us or if you find a workaround. We recently upgraded to 2022.1 but are now facing the prospect of reverting back to 2021.x, reverting changes to our shaders etc. all because of this one issue.

Hi @oobartez ! Could you tell me which Scale Mode you are using and which Scale ratio / reference DPI ? This property can be found in the Panel Settings.

By default, the cursor is drawn at 1 Pixel wide. From my current findings, it seems that using a scale ratio of less than 1 can result in the cursor being scaled down to less than 1 pixel and thus not appearing. As a temporary workaround, setting the scale ratio to 1 or more should fix the issue.

Hi @HugoBD-Unity

To answer your question, we are using Scale Mode: Scale With Screen Size.
Match Mode is set to Match Width Or Height.
Reference resolution is set to 1920x1080 and Match is set to 0.8.

We are using PanelSettings.scale to allow user to adjust UI to their preferences.

So as far as I understand it, for users with FullHD resolutions or higher (and not decreasing scale too much) there is no problem. But when someone plays in a window, smaller resolution or decreases the scale - caret disappear.

Any ideas on how to (temp) fix it are more then welcome!

Hi @pawelduda !

Unfortunately, there are no workarounds… Good news is we have a fix. It still needs to go through our usual landing process (testing, CI…) and then it will be backported down to 2022.1. I can’t say an exact ETA for completing the whole landing process, but we are actively working on it.

Hi @anon_49685404
Is there any progress on backporting this issue to 2022.1?
It is critical as we cannot release our game with invisible carets.

The fix has landed in 2023.1, it has been backported to 2022.2 and 2022.1. We are expecting the fix to land in these earlier versions shortly.

The fixes aforementioned landed in 2022.1 during the weekend. They will be avail,able in 2022.1.18f1 which should be available on September 28 if everything goes well.

The fixes for 2022.2 are still expected to land shortly.

@HugoBD-Unity This is great to hear but please note that the bug with scrollbars is preventing us from upgrading:

So we are still stuck with 2022.1.6 - missing 3 months of other bug fixes, including the bug with carets.

@oobartez there’s more info on UUM-10441 in this thread .

@HugoBD-Unity @benoitd_unity Are you really suggesting that despite being stuck on 2022.1.6 and already missing three months of important bug fixes, we should wait a few more months for 2022.2 before we will be able to update?

A quick update from a few minutes ago in the other thread - it appears that there is now chance for a backport:

@HugoBD-Unity I can see that the bug fix for disappearing carets landed in 2022.1.18 but the scrolls are still not working, so we are stuck on the 3.5 month old 2022.1.6 - and so are probably most developers who use UI Toolkit.

Hi @oobartez the scrolling issue is fixed and should land in 2022.1 shortly. Again, sorry for the delays

1 Like