feat(Storybook): scrollbar and button for clearing search input added

This commit is contained in:
Michał Cieślak 2023-04-19 13:23:00 +02:00 committed by Michał
parent 038ab08765
commit 1ac4c34a63
2 changed files with 19 additions and 7 deletions

View File

@ -32,15 +32,25 @@ ColumnLayout {
sourceModel: filteredModel
}
TextField {
id: textField
RowLayout {
Layout.fillWidth: true
placeholderText: "search"
Keys.onEscapePressed: {
text = ""
focus = false
TextField {
id: textField
Layout.fillWidth: true
placeholderText: "search"
Keys.onEscapePressed: {
clear()
focus = false
}
}
ToolButton {
text: "❌"
onClicked: textField.clear()
}
}

View File

@ -15,6 +15,8 @@ ListView {
readonly property string foldedPrefix: "▶ "
readonly property string unfoldedPrefix: "▼ "
ScrollBar.vertical: ScrollBar {}
delegate: ItemDelegate {
id: delegate