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
- Open Ping and add two custom targets.
- Tab to the first custom target's remove button and press Space.
- 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
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:NetworkSharedState.RemoveTargetcallsTargets.Remove). WPF then moves focus to the list itself rather than to the target now in its place.Sessions.RemoveAtinAudioMixerViewModel), and a slider or button in that row loses focus the same way.RebuildFocus.Keepalready handles any change to a list's items, not only a full rebuild, but neither list sets it, andArchitectureTests.EveryListRebuiltInBulk_KeepsKeyboardFocusOnItsRowsonly asks it of lists refilled withReplaceWith.Steps to reproduce
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