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