Strip leading and trailing whitespace from input address

This commit is contained in:
napoly 2023-05-21 10:17:25 +02:00
parent b52be27a99
commit cf7518b85d

View file

@ -211,6 +211,8 @@ public class PaymentController extends WalletFormController implements Initializ
});
address.textProperty().addListener((observable, oldValue, newValue) -> {
String strippedNewValue = newValue.strip();
if (newValue.equals(strippedNewValue)) {
address.leftProperty().set(null);
if(payNymProperty.get() != null && !newValue.equals(payNymProperty.get().nymName())) {
@ -258,6 +260,9 @@ public class PaymentController extends WalletFormController implements Initializ
if(validationSupport != null) {
validationSupport.setErrorDecorationEnabled(true);
}
} else {
address.setText(strippedNewValue);
}
});
label.textProperty().addListener((observable, oldValue, newValue) -> {