fix(StatusSeedPhraseInput): handle 3 characters mnemonics

This commit is contained in:
Richard Ramos 2022-04-05 15:40:17 -04:00 committed by r4bbit.eth
parent 88b7f6eab8
commit 51989c0f5d
1 changed files with 8 additions and 3 deletions

View File

@ -88,7 +88,7 @@ Item {
} }
} }
seedSuggestionsList.model = filteredList; seedSuggestionsList.model = filteredList;
if ((text.length === 4) && (filteredList.count === 1) && if ((text.length >= 3) && (filteredList.count === 1) &&
((input.edit.keyEvent !== Qt.Key_Backspace) && (input.edit.keyEvent !== Qt.Key_Delete))) { ((input.edit.keyEvent !== Qt.Key_Backspace) && (input.edit.keyEvent !== Qt.Key_Delete))) {
seedWordInput.text = filteredList.get(0).seedWord.trim(); seedWordInput.text = filteredList.get(0).seedWord.trim();
seedWordInput.input.edit.cursorPosition = seedWordInput.text.length; seedWordInput.input.edit.cursorPosition = seedWordInput.text.length;
@ -100,6 +100,11 @@ Item {
} }
} }
onKeyPressed: { onKeyPressed: {
if (input.edit.keyEvent === Qt.Key_Tab) {
if (text.length != 0){
root.doneInsertingWord(seedWordInput.text);
}
}
root.keyPressed(event); root.keyPressed(event);
} }
onEditClicked: { onEditClicked: {
@ -169,8 +174,8 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: true
onClicked: { onClicked: {
seedWordInput.text = seedWord.trim(); root.seedWordInput.input.edit.text = seedWord.trim();
seedWordInput.input.edit.cursorPosition = seedWordInput.text.length; root.seedWordInput.input.edit.cursorPosition = seedWordInput.text.length;
root.doneInsertingWord(seedWordInput.text); root.doneInsertingWord(seedWordInput.text);
seedSuggestionsList.model = 0; seedSuggestionsList.model = 0;
} }