summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VTextField.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/client/src/com/vaadin/client/ui/VTextField.java b/client/src/com/vaadin/client/ui/VTextField.java
index 1229eda093..0fbed0dd90 100644
--- a/client/src/com/vaadin/client/ui/VTextField.java
+++ b/client/src/com/vaadin/client/ui/VTextField.java
@@ -272,19 +272,16 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler,
/** For internal use only. May be removed or replaced in the future. */
public void setMaxLength(int newMaxLength) {
- if (newMaxLength >= 0 && newMaxLength != maxLength) {
- maxLength = newMaxLength;
- updateMaxLength(maxLength);
- } else if (maxLength != -1) {
- maxLength = -1;
- updateMaxLength(maxLength);
+ if (newMaxLength == maxLength) {
+ return;
}
-
+ maxLength = newMaxLength;
+ updateMaxLength(maxLength);
}
/**
- * This method is reponsible for updating the DOM or otherwise ensuring that
- * the given max length is enforced. Called when the max length for the
+ * This method is responsible for updating the DOM or otherwise ensuring
+ * that the given max length is enforced. Called when the max length for the
* field has changed.
*
* @param maxLength