Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Assets/Tests/InputSystem.Editor/InputActionsEditorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ListView>("action-maps-list-view");

// Select an action map and make sure the list holds keyboard focus before deleting.
var actionMapItem = actionMapsContainer.Query<InputActionMapsTreeViewItem>().ToList();
SimulateClickOn(actionMapItem[1]);
yield return WaitForFocus(listView);

SimulateDeleteCommand();

yield return WaitUntil(() => actionMapsContainer.Query<InputActionMapsTreeViewItem>().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()
{
Expand Down
2 changes: 2 additions & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading