A DESCRIPTION OF THE PROBLEM :
When the user scrolls the mouse wheel to navigate through the tabs in a TabPane, the tabs move in the opposite direction.
For example, when a user opens a website in a browser and is at the top of the page, they scroll the mouse wheel down (toward themselves) to view the lower part of the page. However, if they open a vertical TabPane with many tabs — where the first tab is at the top — they must scroll the mouse wheel up (away from themselves) to see the lower tabs.
This behavior is very confusing for users and can even drive them crazy over time.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please, run the provided code and try to scroll the tabs in the TabPane using mouse wheel.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
To see the lower tabs, it is necessary to scroll the mouse wheel down (toward yourself).
ACTUAL -
To see the lower tabs, it is necessary to scroll the mouse wheel up (away from yourself).
---------- BEGIN SOURCE ----------
public class TestFx extends Application {
@Override
public void start(Stage primaryStage) {
var tabPane = new TabPane();
tabPane.setSide(Side.RIGHT);
for (var i = 0; i < 20; i++) {
var tab = new Tab("Test " + i);
tabPane.getTabs().add(tab);
}
VBox.setVgrow(tabPane, Priority.ALWAYS);
var root = new VBox(tabPane);
Scene scene = new Scene(root, 500, 300);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
When the user scrolls the mouse wheel to navigate through the tabs in a TabPane, the tabs move in the opposite direction.
For example, when a user opens a website in a browser and is at the top of the page, they scroll the mouse wheel down (toward themselves) to view the lower part of the page. However, if they open a vertical TabPane with many tabs — where the first tab is at the top — they must scroll the mouse wheel up (away from themselves) to see the lower tabs.
This behavior is very confusing for users and can even drive them crazy over time.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please, run the provided code and try to scroll the tabs in the TabPane using mouse wheel.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
To see the lower tabs, it is necessary to scroll the mouse wheel down (toward yourself).
ACTUAL -
To see the lower tabs, it is necessary to scroll the mouse wheel up (away from yourself).
---------- BEGIN SOURCE ----------
public class TestFx extends Application {
@Override
public void start(Stage primaryStage) {
var tabPane = new TabPane();
tabPane.setSide(Side.RIGHT);
for (var i = 0; i < 20; i++) {
var tab = new Tab("Test " + i);
tabPane.getTabs().add(tab);
}
VBox.setVgrow(tabPane, Priority.ALWAYS);
var root = new VBox(tabPane);
Scene scene = new Scene(root, 500, 300);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
- relates to
-
JDK-8133197 Wrong scrolling direction for TabPane
-
- Resolved
-
-
JDK-8334874 Horizontal scroll events from touch pads should scroll the TabPane tabs
-
- Resolved
-