Fix Dropdown/SearchableDropdown integration issues
This commit is contained in:
@@ -136,7 +136,13 @@ Item {
|
|||||||
radius: Style.cornerRadius
|
radius: Style.cornerRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
onOpened: optionList.currentIndex = Math.max(0, optionList.indexOfValue(root.value))
|
onOpened: {
|
||||||
|
optionList.currentIndex = Math.max(0, optionList.indexOfValue(root.value))
|
||||||
|
optionList.forceActiveFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
contentItem: ListView {
|
||||||
|
id: optionList
|
||||||
|
|
||||||
Keys.onPressed: function(event) {
|
Keys.onPressed: function(event) {
|
||||||
if (event.key === Qt.Key_Escape) { popup.close(); event.accepted = true }
|
if (event.key === Qt.Key_Escape) { popup.close(); event.accepted = true }
|
||||||
@@ -150,9 +156,6 @@ Item {
|
|||||||
optionList.selectCurrent(); event.accepted = true
|
optionList.selectCurrent(); event.accepted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: ListView {
|
|
||||||
id: optionList
|
|
||||||
implicitHeight: contentHeight
|
implicitHeight: contentHeight
|
||||||
clip: true
|
clip: true
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls as QQC
|
||||||
import qs.Commons
|
import qs.Commons
|
||||||
|
|
||||||
// Searchable single-select dropdown. Same trigger shape as Dropdown, but
|
// Searchable single-select dropdown. Same trigger shape as Dropdown, but
|
||||||
@@ -140,7 +140,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Popup {
|
QQC.Popup {
|
||||||
id: popup
|
id: popup
|
||||||
x: 0
|
x: 0
|
||||||
y: trigger.height + 2
|
y: trigger.height + 2
|
||||||
|
|||||||
@@ -787,7 +787,6 @@ Item {
|
|||||||
}
|
}
|
||||||
foreground: root.foreground
|
foreground: root.foreground
|
||||||
accent: root.accent
|
accent: root.accent
|
||||||
cornerRadius: root.cornerRadius
|
|
||||||
fontFamily: root.fontFamily
|
fontFamily: root.fontFamily
|
||||||
onChanged: function(v) { if (v) root.addEntry(section.sectionKey, v) }
|
onChanged: function(v) { if (v) root.addEntry(section.sectionKey, v) }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user