Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

1.3.0

1.5.0

Issue ID

ISXB-100

Regression

No

[Input System] UI Toolkit elements are not focused when entering Play mode with New Input System

Package: Input System

-

Reproduction steps:
1. Open the attached user's Unity project "NewFocus.zip"
2. Go to Assets > Scenes folder and open "SampleScene.unity" Scene
3. Enter the Play mode and press the "Enter" key
4. Observe the Game view

Expected result: The cube appears in the Game view after pressing the "Enter" key
Actual result: The cube does not appear in the Game view after pressing the "Enter" key

Reproducible with: 1.2.0, 1.3.0 (2021.2.19f1, 2021.3.1f1, 2022.1.0f1, 2022.2.0a10)
Could not test with: 2019.4.38f1, 2020.3.33f1 (Project breaks after downgrade)

Notes:
- The issue is not reproducible with Old Input System

  1. Resolution Note:

    The firstButton.Focus() is currently called in the OnEnable() method. That does not work because the focused element needs to be provided in the Start() method. Otherwise the EventManager initialization is done, without the event manager knowing the first selected element. So the best practice at the moment is to use the .Focus() method in Start(). I am referring to the following documentation: https://docs.unity3d.com/Manual/UIE-faq-event-and-input-system.html

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.