diff --git a/core/src/main/java/bisq/core/util/validation/InputValidator.java b/core/src/main/java/bisq/core/util/validation/InputValidator.java index 7fee474daae..7ce3d68a5eb 100644 --- a/core/src/main/java/bisq/core/util/validation/InputValidator.java +++ b/core/src/main/java/bisq/core/util/validation/InputValidator.java @@ -21,6 +21,7 @@ import java.math.BigInteger; +import java.util.Objects; import java.util.function.Function; public class InputValidator { @@ -65,6 +66,12 @@ public String toString() { '}'; } + public boolean errorMessageEquals(ValidationResult other) { + if (this == other) return true; + if (other == null) return false; + return Objects.equals(errorMessage, other.errorMessage); + } + public interface Validator extends Function { } diff --git a/desktop/src/main/java/bisq/desktop/components/InputTextField.java b/desktop/src/main/java/bisq/desktop/components/InputTextField.java index abe9b49468b..73130745062 100644 --- a/desktop/src/main/java/bisq/desktop/components/InputTextField.java +++ b/desktop/src/main/java/bisq/desktop/components/InputTextField.java @@ -78,6 +78,9 @@ public InputTextField() { if (newValue != null) { resetValidation(); if (!newValue.isValid) { + if (!newValue.errorMessageEquals(oldValue)) { // avoid blinking + validate(); // ensure that the new error message replaces the old one + } if (this.errorMessage != null) { jfxValidationWrapper.applyErrorMessage(this.errorMessage); } else {