changeset 7208:0531e969fa87

RT-37185: [Menu] In a huge menu, the upward scrolling arrow stops working (regression)
author jgiles
date Tue, 03 Jun 2014 09:55:10 +1200
parents edb590702b98
children 30125e062b9e
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Mon Jun 02 17:25:29 2014 -0400
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ContextMenuContent.java	Tue Jun 03 09:55:10 2014 +1200
@@ -889,8 +889,11 @@
 
         // translation should never be greater than the preferred height of the
         // menu content (otherwise the menu content will be detaching from the
-        // bottom of the menu)
-        if (getHeight() - newTy > itemsContainer.getHeight()) {
+        // bottom of the menu).
+        // RT-37185: We check the direction of the scroll, to prevent it locking
+        // up when scrolling upwards from the very bottom (using the on-screen
+        // up arrow).
+        if (delta < 0 && (getHeight() - newTy) > itemsContainer.getHeight() - downArrow.getHeight()) {
             newTy = getHeight() - itemsContainer.getHeight() - downArrow.getHeight();
         }