-
Bug
-
Resolution: Fixed
-
P3
-
jfx17, jfx18
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8286006 | jfx17.0.4 | Johan Vos | P3 | Resolved | Fixed |
OS - Windows 10 20H2
Java (JRE) - 11.0.12
JavaFX - 17.0.1
A DESCRIPTION OF THE PROBLEM :
The "scrollTo" feature on ListView is no longer working on JavaFX 17 or 18 early access builds.
It works fine if I downgrade to JavaFX16
It neither sorts by index nor by the object
countriesListView.scrollTo(lastSelectedIndex);
REGRESSION : Last worked in openjfx 16
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a list view in JavaFX
Insert 15-20 elements, such that you get a scrollpane on it.
invoke
listView.scrollTo(10); //Scroll to 10th index i.e. 11th element
Launch the program and you'd notice the list didn't scroll to the selected element (scrollTo doesn't work)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
List View should scroll down to the given index/element in listView.scrollTo() method call.
ACTUAL -
listView does not scrollTo the given index/element and the focus is always at the beginning of the listView i.e. the first element
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class ListClass extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("ListView ScrollTest");
ListView listView = new ListView();
listView.getItems().add("Item 1");
listView.getItems().add("Item 2");
listView.getItems().add("Item 3");
listView.getItems().add("Item 4");
listView.getItems().add("Item 5");
listView.getItems().add("Item 6");
listView.getItems().add("Item 7");
listView.getItems().add("Item 8");
listView.getItems().add("Item 9");
listView.getItems().add("Item 10");
listView.getItems().add("Item 11");
listView.getItems().add("Item 12");
listView.getItems().add("Item 13");
listView.getItems().add("Item 14");
listView.getItems().add("Item 15");
listView.getItems().add("Item 16");
listView.getSelectionModel().select(10);
listView.scrollTo(10);
HBox hbox = new HBox(listView);
Scene scene = new Scene(hbox, 300, 120);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use JavaFX 16
FREQUENCY : always
- backported by
-
JDK-8286006 ListView scrollTo() is broken after fix for JDK-8089589
-
- Resolved
-
- duplicates
-
JDK-8306923 ScrollTo does not work if the view is already displayed
-
- Closed
-
-
JDK-8276804 The scrollTo method of the TableView component does not lead to the right place
-
- Closed
-
- relates to
-
JDK-8276056 Control.skin.setSkin(Skin) fails to call dispose() on discarded Skin
-
- Resolved
-
-
JDK-8277785 ListView scrollTo jumps to wrong location when CellHeight is changed
-
- Resolved
-
-
JDK-8089589 [ListView] ScrollBar content moves toward-backward during scrolling.
-
- Resolved
-
-
JDK-8291467 TableView not properly refreshed after scroll to bottom
-
- Closed
-
-
JDK-8281207 TableView scrollTo() will not show last row for a custom cell factory.
-
- Closed
-
- links to
-
Commit openjdk/jfx17u/83534e2d
-
Commit openjdk/jfx/d3fbb516
-
Review openjdk/jfx17u/50
-
Review openjdk/jfx/683