Skip to content

[Bug]: Ping and Audio Mixer — keyboard focus does not move to the next row when the focused row is removed #2650

Description

@laurentiu021

Problem

#2609 brings keyboard focus back after a list is refilled with ReplaceWith. Two lists remove one row at a time instead, and focus still goes with the row:

  • Ping: the remove button on a custom target removes its row (NetworkSharedState.RemoveTarget calls Targets.Remove). WPF then moves focus to the list itself rather than to the target now in its place.
  • Audio Mixer: when an app's audio session ends, its row is removed (Sessions.RemoveAt in AudioMixerViewModel), and a slider or button in that row loses focus the same way.

RebuildFocus.Keep already handles any change to a list's items, not only a full rebuild, but neither list sets it, and ArchitectureTests.EveryListRebuiltInBulk_KeepsKeyboardFocusOnItsRows only asks it of lists refilled with ReplaceWith.

Steps to reproduce

  1. Open Ping and add two custom targets.
  2. Tab to the first custom target's remove button and press Space.
  3. Focus is no longer on a target's row: it is on the list as a whole, not on the target now in the removed one's place.

Expected behavior

Removing the focused row moves focus to the row now in its place, as a rebuild does since #2609. Both lists set helpers:RebuildFocus.Keep="True", and the guard also covers lists whose rows are removed one at a time.

Affected tab

Ping, Audio Mixer

Activity

  1. laurentiu021 commented on Oct 10, 2026

    @laurentiu021
    OwnerAuthor

    Fixed in #2669, released in 1.128.5.

    Ping's targets and Volume Control's sessions now set helpers:RebuildFocus.Keep="True", so removing a custom target, or an app's sound session ending, moves keyboard focus to the same control in the row now in the removed one's place, or in the last row when the last one went. The console's output and the sidebar's search results lost their rows the same way, to RemoveAt and Clear, and set it too.

    ArchitectureTests.EveryListThatLosesRows_KeepsKeyboardFocusOnItsRows, which only asked this of lists refilled with ReplaceWith, now covers an ObservableCollection as well as a BulkObservableCollection, and rows lost to Clear, Remove or RemoveAt: 25 lists, where it read 21. RebuildFocusTests has two cases for a row removed on its own.

    Files: Views/PingView.xaml, Views/AudioMixerView.xaml, Views/ConsoleView.xaml, MainWindow.xaml, ArchitectureTests.cs, RebuildFocusTests.cs, CHANGELOG and ARCHITECTURE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions