Skip to content

Commit

Permalink
KeystrokeEditorBuilder: ensure first selected list item is inside scr…
Browse files Browse the repository at this point in the history
…oll viewport after init
  • Loading branch information
bwRavencl committed Feb 2, 2025
1 parent ac610e1 commit b7bf2c9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ private void initListSelection(final JList<?> list, final ScanCode[] scanCodes)
list.addSelectionInterval(index, index);
}
});

final var minSelectionIndex = list.getMinSelectionIndex();
if (minSelectionIndex >= 0) {
list.ensureIndexIsVisible(minSelectionIndex);
}
}

private void updateUpdateKeyStrokeVisualization() {
Expand Down

0 comments on commit b7bf2c9

Please sign in to comment.