Browse Source

Merge pull request #11674 from Ultimaker/CURA-9039_combobox_open_out_of_window

[CURA-9039] fix combobox scrolling out of view
Joey de l'Arago 3 years ago
parent
commit
fcfc47920f

+ 8 - 0
resources/qml/Preferences/GeneralPage.qml

@@ -148,6 +148,14 @@ UM.PreferencesPage
                 bottom: parent.bottom
                 right: parent.right
             }
+
+            onPositionChanged: {
+                // This removes focus from items when scrolling.
+                // This fixes comboboxes staying open and scrolling container
+                if (!activeFocus) {
+                    forceActiveFocus();
+                }
+            }
         }
 
         Column

+ 9 - 7
resources/qml/Settings/SettingView.qml

@@ -188,13 +188,15 @@ Item
         }
         clip: true
         cacheBuffer: 1000000   // Set a large cache to effectively just cache every list item.
-        ScrollBar.vertical: UM.ScrollBar { id: scrollBar }
-
-        onContentYChanged: {
-        // This removes focus from SettingItems when scrolling.
-        // This fixes comboboxes staying open and scrolling out of the settingView.
-            if (!scrollBar.activeFocus) {
-                scrollBar.forceActiveFocus();
+        ScrollBar.vertical: UM.ScrollBar
+        {
+            id: scrollBar
+            onPositionChanged: {
+                // This removes focus from items when scrolling.
+                // This fixes comboboxes staying open and scrolling container
+                if (!activeFocus) {
+                    forceActiveFocus();
+                }
             }
         }