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

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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.