diff --git a/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs b/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs index 96a51f9a7a..04209a0ea7 100644 --- a/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs +++ b/Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs @@ -189,6 +189,27 @@ public IEnumerator CanDeleteActionMap() Assert.That(m_Window.currentAssetInEditor.actionMaps[1].name, Is.EqualTo("Third Name")); } + [UnityTest] + public IEnumerator ActionMapsList_WhenMapDeletedViaKeyboard_ListRetainsFocus() + { + var actionMapsContainer = m_Window.rootVisualElement.Q("action-maps-container"); + var listView = m_Window.rootVisualElement.Q("action-maps-list-view"); + + // Select an action map and make sure the list holds keyboard focus before deleting. + var actionMapItem = actionMapsContainer.Query().ToList(); + SimulateClickOn(actionMapItem[1]); + yield return WaitForFocus(listView); + + SimulateDeleteCommand(); + + yield return WaitUntil(() => actionMapsContainer.Query().ToList().Count == 2, "wait for element to be deleted"); + + // After the post-delete rebuild destroys the previously focused row, focus must be + // returned to the list so keyboard shortcuts keep flowing without an extra click. + yield return WaitForFocus(listView); + Assert.That(listView.focusController.focusedElement, Is.EqualTo(listView)); + } + [UnityTest] public IEnumerator CanRenameAction() { diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index cb02afbecf..dee187e786 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] - yyyy-mm-dd +### Fixed +- Fixed the Action Maps list in the Input Actions editor losing keyboard focus after deleting a map, so that Delete, Duplicate, and arrow-key navigation kept working on the auto-selected replacement map without requiring an extra click [UUM-147152](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-147152) ## [1.20.0] - 2026-07-21 diff --git a/Packages/com.unity.inputsystem/Documentation~/introduction-on-screen-controls.md b/Packages/com.unity.inputsystem/Documentation~/introduction-on-screen-controls.md index b6bf80fc39..9e5ff3f4cf 100644 --- a/Packages/com.unity.inputsystem/Documentation~/introduction-on-screen-controls.md +++ b/Packages/com.unity.inputsystem/Documentation~/introduction-on-screen-controls.md @@ -1,5 +1,5 @@ --- -uid: input-system-on-screen +uid: input-system-introduction-on-screen --- # Introduction to on-screen controls diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs index ae8537d19e..1f1a944de0 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/ActionMapsView.cs @@ -131,6 +131,9 @@ internal void RenameActionMap(int index) internal void DeleteActionMap(int index) { Dispatch(Commands.DeleteActionMap(index)); + + // Deleting an item sometimes causes the UI Panel to lose focus; make sure we keep it + m_ListView.Focus(); } internal void DuplicateActionMap(int index)