Skip to content

Commit 78cf318

Browse files
committed
fix: Fix the issue where the dropdown remains highlighted after being moved out
Fix the issue where the dropdown remains highlighted after being moved out Log: Fix the issue where the dropdown remains highlighted after being moved out pms: BUG-304991
1 parent fef6c93 commit 78cf318

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

qt6/src/qml/ComboBox.qml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ T.ComboBox {
1919
property int maxVisibleItems : DS.Style.comboBox.maxVisibleItems
2020
property D.Palette separatorColor: DS.Style.comboBox.edit.separator
2121
property var horizontalAlignment: control.flat ? Text.AlignRight : Text.AlignLeft
22+
property bool mouseInPopupContent: false
2223
opacity: enabled ? 1.0 : 0.4
2324

2425
implicitWidth: DS.Style.control.implicitWidth(control)
@@ -34,12 +35,16 @@ T.ComboBox {
3435
useIndicatorPadding: true
3536
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : (model[control.textRole] === undefined ? modelData[control.textRole] : model[control.textRole])) : modelData
3637
icon.name: (control.iconNameRole && model[control.iconNameRole] !== undefined) ? model[control.iconNameRole] : null
37-
highlighted: control.highlightedIndex === index
38+
highlighted: (control.mouseInPopupContent || (subMenu && subMenu.visible)) && control.highlightedIndex === index
3839
hoverEnabled: control.hoverEnabled
3940
autoExclusive: true
4041
checked: control.currentIndex === index
4142
}
4243

44+
onHighlightedIndexChanged: {
45+
mouseInPopupContent = true
46+
}
47+
4348
indicator: Loader {
4449
sourceComponent: control.editable ? editableIndicator : normalIndicator
4550
x: control.mirrored ? control.padding : control.width - width - control.padding
@@ -172,6 +177,12 @@ T.ComboBox {
172177
view.currentIndex: control.highlightedIndex
173178
view.highlightRangeMode: ListView.ApplyRange
174179
view.highlightMoveDuration: 0
180+
181+
HoverHandler {
182+
onHoveredChanged: {
183+
control.mouseInPopupContent = hovered
184+
}
185+
}
175186
}
176187

177188
background: FloatingPanel {

0 commit comments

Comments
 (0)