combo box list keeps snapping to top
Unsolved
Mobile and Embedded
-
I have a fairly generic combo box that I use across my application. Nothing fancy, just a simple combo box that is stylized for my app's aesthetics.
My problem is that in one instance of this combo box, there are now two many selection options to fit on the screen. When I try to scroll to the bottom of the list, it always snaps back to the first item, making it impossible to see part of the list. Can anyone tell me why it's like this or how to get it to allow me to scroll to the bottom?
import QtQuick import QtQuick.Controls ComboBox{ id: myComboBox property real cornerRadii: 30 font.family: "Helvetica" delegate: ItemDelegate { width: myComboBox.width contentItem: Text { text: modelData color: parent.highlighted ? "#000000" : "#FFFFFF" font: myComboBox.font elide: Text.ElideRight horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } background: Rectangle { //implicitWidth: parent.width //implicitHeight: parent.height //visible: myComboBox.down || myComboBox.highlighted || myComboBox.visualFocus color: parent.highlighted ? "#FFFFFF" : "#00000000" border.color: parent.highlighted ? "#00000000" : "#FFFFFF" border.width: 1 radius: myComboBox.cornerRadii } highlighted: myComboBox.highlightedIndex === index } background: Rectangle { width: parent.width height: parent.height color: "#D0000000" border.color: "#FFFFFF" border.width: 1 radius: myComboBox.cornerRadii } contentItem: Text { leftPadding: .01*parent.width rightPadding: parent.indicator.width + parent.spacing text: parent.displayText font: parent.font color: parent.pressed ? "#C0C0C0" : "#FFFFFF" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter elide: Text.ElideNone } popup: Popup { y: parent.height - 1 width: parent.width implicitHeight: contentItem.implicitHeight padding: 1 font: parent.font //delete this? contentItem: ListView { clip: true implicitHeight: contentHeight model: myComboBox.popup.visible ? myComboBox.delegateModel : null currentIndex: myComboBox.highlightedIndex ScrollIndicator.vertical: ScrollIndicator { } } background: Rectangle { border.color: "#FFFFFF" color: "#D0000000" radius: myComboBox.cornerRadii } } }