Search Issue Tracker
By Design
Votes
0
Found in
4.6.1f1
Issue ID
658087
Regression
No
[InputField] OnSelect() is not triggered when removing focus with return key and clicking on input field again
Steps to reproduce this issue:
1. Open the attached project
2. Open 'OnSelectTest' scene
3. It has input fields which trigger OnSelect() when selecting it
4. Play the scene
5. Click on input field
6. Notice that the Debug.Log message is called.
7. Press Return or Enter on your keyboard to remove focus from the InputField
8. Click on the InputField again
9. Notice that NO Debug.Log message was called. This shows that removing focus through a keyboard key press does not allow the Select event to be fired later when expected.
If you remove focus from input field with mouse click then it works as expected
Comments (1)
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
- [URP] Crash on GameObject::QueryComponentByType when baking a Reflection Probe in an unsaved/untitled Scene
- No Icons are used for the Entry and Exit States in the Inspector when selected in an Animator Controller
- Crash on PlayerMain(int, char const**) when exiting Standalone Player with a Particle System in the Scene
- No Icon is used for the Runtime Animator Controller Type in a Search Window when assigning an Animator Controller in the Animator Component
- Unity Version Control server textfield’s text overlaps with the dropdown triangle button in the Explore repositories window when an organization with a long name is selected
Reelix
Sep 03, 2018 18:33
Here's a hack to fix it.
theInputField.onEndEdit.AddListener(delegate { IsSelected(false); });
private void IsSelected(bool isSelected)
{
if (isSelected == false)
{
EventSystem theSystem = EventSystem.current;
if (!theSystem.alreadySelecting)
{
theSystem.SetSelectedGameObject(null);
}
}
}