-
Notifications
You must be signed in to change notification settings - Fork 886
Fix #5307 #5037 : 列表点击后无法 esc 返回 #5311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,7 @@ private ResourcepackListPageSkin(ResourcepackListPage control) { | |
| center.getStyleClass().add("large-spinner-pane"); | ||
| center.loadingProperty().bind(control.loadingProperty()); | ||
|
|
||
| listView.setFocusTraversable(false); | ||
|
||
| listView.setCellFactory(x -> new ResourcepackListCell(listView, control)); | ||
| Bindings.bindContent(listView.getItems(), control.getItems()); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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 usingToolbarListPageSkin(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 (seeFXUtils.ignoreEvent(...)usage inversions/ModListPageSkin.java/versions/DatapackListPageSkin.java). Consider replacing this with an ESC-specificFXUtils.ignoreEvent(listView, KeyEvent.KEY_PRESSED, e -> e.getCode() == KeyCode.ESCAPE)so ESC reachesDecoratorController’s global handler while preserving normal focus/keyboard behavior.