Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public ToolbarListPageSkin(P skinnable) {
{
this.listView = new JFXListView<>();
this.listView.setPadding(Insets.EMPTY);
this.listView.setFocusTraversable(false);
this.listView.setCellFactory(listView -> createListCell((JFXListView<E>) listView));
Comment on lines 64 to 66

Copilot AI Jan 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listView.setFocusTraversable(false) changes focus behavior for every page using ToolbarListPageSkin (Java management, installer list, world list, etc.) and can break keyboard navigation/selection in these lists. The underlying ESC/back problem is typically handled more narrowly by letting ESC bypass the ListView dispatcher (see FXUtils.ignoreEvent(...) usage in versions/ModListPageSkin.java / versions/DatapackListPageSkin.java). Consider replacing this with an ESC-specific FXUtils.ignoreEvent(listView, KeyEvent.KEY_PRESSED, e -> e.getCode() == KeyCode.ESCAPE) so ESC reaches DecoratorController’s global handler while preserving normal focus/keyboard behavior.

Copilot uses AI. Check for mistakes.
ComponentList.setVgrow(listView, Priority.ALWAYS);
Bindings.bindContent(this.listView.getItems(), skinnable.itemsProperty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ private ResourcepackListPageSkin(ResourcepackListPage control) {
center.getStyleClass().add("large-spinner-pane");
center.loadingProperty().bind(control.loadingProperty());

listView.setFocusTraversable(false);

Copilot AI Jan 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the ListView to non-focus-traversable is a very broad fix for the ESC/back issue and can regress keyboard interaction (arrow-key navigation, type-to-select, accessibility focus). In other list pages (e.g., versions/ModListPageSkin.java and versions/DatapackListPageSkin.java) the pattern is to bypass ListViewBehavior only for ESC via FXUtils.ignoreEvent(listView, KeyEvent.KEY_PRESSED, e -> e.getCode() == KeyCode.ESCAPE) so ESC can reach the global handler without disabling focus entirely. Consider switching to that approach here instead of setFocusTraversable(false).

Copilot uses AI. Check for mistakes.
listView.setCellFactory(x -> new ResourcepackListCell(listView, control));
Bindings.bindContent(listView.getItems(), control.getItems());

Expand Down
Loading