Search Issue Tracker
Fixed
Fixed in 2022.3.20f1, 2023.2.9f1, 2023.3.0b5
Votes
3
Found in
2022.3.8f1
2023.1.0b11
2023.2.0a9
2023.3.0a1
Issue ID
UUM-32184
Regression
No
Input Field ignores first keyboard input when calling Focus() from code
Reproduction steps:
1. Open the attached “FieldEdit.zip” project
2. Open the “Assets/Test Scene.unity” Scene
3. Enter the Play Mode
4. Click on the second from the top “click me” button in the Game View
5. Type “UnityEditor”
Expected result: Full “UnityEditor” is inputted in the second Input Field
Actual result: “nityEditor” is inputted in the first Input Field, the first character is missing
Reproducible with: 2022.2.13f1, 2023.1.0b11, 2023.2.0a9
Couldn’t test with: 2020.3.47f1, 2021.3.22f1 (Script errors)
Reproducible on: Windows 10 Pro (22H2)
Notes:
- This issue is also apparent with Float Fields
- Typing something that begins with “w” forces the input into the second Input Field instead of the first one
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
StefanWo
Aug 30, 2023 20:51
Here is maybe another hint. From inside a click event it seems working.
https://forum.unity.com/threads/textfield-ignores-key-input-when-focus-is-used.1432006/
Any updates on this? That really goes players on their nerves... There is no way to autofocus an input without running into this bug.
StefanWo
May 21, 2023 02:06
Same problem here with Unity 2022.2.19
Even when attaching own KeyDownHandlers for the element, they are not fired at the first key press.