fix(StatusSeedPhraseInput): fix notifying inserting word done (#841)

This commit is contained in:
Michał 2022-08-08 17:38:43 +02:00 committed by GitHub
parent 789b773649
commit 56f36ed627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 8 deletions

View File

@ -69,19 +69,34 @@ Column {
textEdit.input.anchors.leftMargin: 16 textEdit.input.anchors.leftMargin: 16
textEdit.input.anchors.rightMargin: 16 textEdit.input.anchors.rightMargin: 16
textEdit.input.anchors.topMargin: 11 textEdit.input.anchors.topMargin: 11
textEdit.label: "Input with drop down selection list" textEdit.label: "Input with drop down selection list" + (insertedWord ? ` (${insertedWord})` : "")
leftComponentText: "1" leftComponentText: "1"
inputList: ListModel { inputList: ListModel {
ListElement {
seedWord: "add"
}
ListElement {
seedWord: "address"
}
ListElement { ListElement {
seedWord: "panda" seedWord: "panda"
} }
ListElement { ListElement {
seedWord: "posible" seedWord: "posible"
} }
ListElement {
seedWord: "win"
}
ListElement {
seedWord: "wine"
}
ListElement { ListElement {
seedWord: "wing" seedWord: "wing"
} }
} }
property string insertedWord: ""
onDoneInsertingWord: insertedWord = word
} }
} }

View File

@ -99,7 +99,6 @@ Item {
signal editClicked() signal editClicked()
function setWord(word) { function setWord(word) {
seedWordInput.ignoreTextChange = true
seedWordInput.input.edit.text = word seedWordInput.input.edit.text = word
} }
@ -110,9 +109,8 @@ Item {
} }
StatusInput { StatusInput {
property bool ignoreTextChange: false
id: seedWordInput id: seedWordInput
implicitWidth: parent.width implicitWidth: parent.width
input.leftComponent: StatusBaseText { input.leftComponent: StatusBaseText {
rightPadding: 6 rightPadding: 6
@ -123,10 +121,6 @@ Item {
} }
input.acceptReturn: true input.acceptReturn: true
onTextChanged: { onTextChanged: {
if (ignoreTextChange) {
ignoreTextChange = false
return
}
filteredList.clear(); filteredList.clear();
let textToCheck = text.trim() let textToCheck = text.trim()
if (textToCheck !== "") { if (textToCheck !== "") {