-
Bug
-
Resolution: Fixed
-
P4
-
9, 10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8255610 | jfx11.0.10 | Thiago Sayao | P4 | Resolved | Fixed |
To reproduce, compile and run the example below:
- press down until the last visible row is selected
- press down again
- expected: table/list is scrolled up by 1 row (such that the newly selected cell now is the last visible row) - that's the behaviour f.i. in win explorer
- actual: table is scrolled up by a bit less than a page (such that the newly selected cell is the second or third row in the viewport - where exactly is hard to predict, seems to change with the amount of pages scrolled)
The example:
/**
* TableView/ListView: unexpected scrolling behaviour on down/up
*
* not tested: TreeView, TreeTableView, might have similar issue
*/
public class TableViewScrollOnNavigationBug extends Application {
private Parent getContent() {
TableView<Locale> table = new TableView<>(FXCollections.observableArrayList(
Locale.getAvailableLocales()));
TableColumn<Locale, String> countryCode = new TableColumn<>("CountryCode");
countryCode.setCellValueFactory(new PropertyValueFactory<>("country"));
TableColumn<Locale, String> language = new TableColumn<>("Language");
language.setCellValueFactory(new PropertyValueFactory<>("language"));
TableColumn<Locale, String> variant = new TableColumn<>("Variant");
variant.setCellValueFactory(new PropertyValueFactory<>("variant"));
table.getColumns().addAll(countryCode, language, variant);
ListView<Locale> list = new ListView<>(table.getItems());
BorderPane pane = new BorderPane(table);
pane.setRight(list);
return pane;
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setScene(new Scene(getContent(), 800, 400));
primaryStage.setTitle(FXUtils.version());
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
- press down until the last visible row is selected
- press down again
- expected: table/list is scrolled up by 1 row (such that the newly selected cell now is the last visible row) - that's the behaviour f.i. in win explorer
- actual: table is scrolled up by a bit less than a page (such that the newly selected cell is the second or third row in the viewport - where exactly is hard to predict, seems to change with the amount of pages scrolled)
The example:
/**
* TableView/ListView: unexpected scrolling behaviour on down/up
*
* not tested: TreeView, TreeTableView, might have similar issue
*/
public class TableViewScrollOnNavigationBug extends Application {
private Parent getContent() {
TableView<Locale> table = new TableView<>(FXCollections.observableArrayList(
Locale.getAvailableLocales()));
TableColumn<Locale, String> countryCode = new TableColumn<>("CountryCode");
countryCode.setCellValueFactory(new PropertyValueFactory<>("country"));
TableColumn<Locale, String> language = new TableColumn<>("Language");
language.setCellValueFactory(new PropertyValueFactory<>("language"));
TableColumn<Locale, String> variant = new TableColumn<>("Variant");
variant.setCellValueFactory(new PropertyValueFactory<>("variant"));
table.getColumns().addAll(countryCode, language, variant);
ListView<Locale> list = new ListView<>(table.getItems());
BorderPane pane = new BorderPane(table);
pane.setRight(list);
return pane;
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setScene(new Scene(getContent(), 800, 400));
primaryStage.setTitle(FXUtils.version());
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
- backported by
-
JDK-8255610 TableView, ListView: unexpected scrolling behaviour on up/down keys
- Resolved
- links to