From 78f5360af278af661c4abc1ee334cfeaffc08491 Mon Sep 17 00:00:00 2001 From: xiphon Date: Mon, 14 Dec 2020 11:57:24 +0000 Subject: [PATCH] Transfer: support pasting amount with whitespaces --- pages/Transfer.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 44edd403..b9b444a0 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -298,7 +298,7 @@ Rectangle { inlineButtonText: qsTr("All") + translationManager.emptyString inlineButton.onClicked: amountLine.text = "(all)" onTextChanged: { - amountLine.text = amountLine.text.replace(",", "."); + amountLine.text = amountLine.text.trim().replace(",", "."); const match = amountLine.text.match(/^0+(\d.*)/); if (match) { const cursorPosition = amountLine.cursorPosition; @@ -314,7 +314,7 @@ Rectangle { } validator: RegExpValidator { - regExp: /^(\d{1,8})?([\.,]\d{1,12})?$/ + regExp: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/ } }