Search Issue Tracker
By Design
Votes
0
Found in
2022.3.17f1
2023.2.7f1
2023.3.0b4
Issue ID
UUM-60816
Regression
Yes
TextField's TextElement position is not updated correctly when changing the text value
How to reproduce:
1. Open the attached project "forte.zip"
2. Open Window>UI Toolkit>Debugger
3. Click Select Panel>Panel Settings in the UI Toolkit Debugger window
4. Enter Play Mode
5. Copy and paste "1234567891123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890" into TextField in the Game view window
6. Press Enter
7. Select Visual Element>TemplateContainer>TextField>TextInput>TextElement in the UI Toolkit Debugger window
Expected results: "World Bound x" is "17.00"
Actual results: "World Bound x" is "-697.00"
Reproducible with: 2022.2.0a12, 2022.3.17f1, 2023.2.7f1, 2023.3.0b4
Not reproducible with: 2021.3.35f1, 2022.2.0a11
Reproducible on: Windows 10 22H2
Not reproducible on: No other environment tested
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Matching Selectors list not updating correctly with element's pseudo-state updates
- [Android] Crash on vendor/lib64/egl/libGLES_mali.so when Graphics Jobs(Experimental) is disabled and the Player is running on the Google Pixel 6 with the March security patch installed
- Profiler does not profile after building the Project with Autoconnect Profiler Option enabled
- Editor slows down when selecting a script with the [HideInInspector] attribute on arrays with dynamic values
- [XR] Custom Pass not working as intended with Single Pass Instanced when XR is initialized after runtime start
Resolution Note:
In 2022.2, the UITK went through a major refactor. More information about the said refactor can be found in the following post: https://forum.unity.com/threads/important-message-related-to-the-textfield-refactor-for-2022-1.1200559/
Simply changing `if (evt.target is TextField field)` to `if (evt.currentTarget == field)` will fix the issue.