Change OnYChanged out for OnPositionChanged inside scrollbar. Makes a bit more sense logically and this can be reused in ScrollViews as well.

Added OnPositionChanged to General Page
CURA-8979
This commit is contained in:
j.delarago 2022-03-16 13:59:22 +01:00
parent b04fabb27a
commit 84d7443c18
2 changed files with 17 additions and 7 deletions

View file

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

View file

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