mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 03:42:05 +02:00
Transfer: support pasting amount with whitespaces
This commit is contained in:
parent
df771470c2
commit
78f5360af2
@ -298,7 +298,7 @@ Rectangle {
|
|||||||
inlineButtonText: qsTr("All") + translationManager.emptyString
|
inlineButtonText: qsTr("All") + translationManager.emptyString
|
||||||
inlineButton.onClicked: amountLine.text = "(all)"
|
inlineButton.onClicked: amountLine.text = "(all)"
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
amountLine.text = amountLine.text.replace(",", ".");
|
amountLine.text = amountLine.text.trim().replace(",", ".");
|
||||||
const match = amountLine.text.match(/^0+(\d.*)/);
|
const match = amountLine.text.match(/^0+(\d.*)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
const cursorPosition = amountLine.cursorPosition;
|
const cursorPosition = amountLine.cursorPosition;
|
||||||
@ -314,7 +314,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validator: RegExpValidator {
|
validator: RegExpValidator {
|
||||||
regExp: /^(\d{1,8})?([\.,]\d{1,12})?$/
|
regExp: /^\s*(\d{1,8})?([\.,]\d{1,12})?\s*$/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user