From c5f692eb8fe1fa2a785468bc7fd999d70ecb716d Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Wed, 14 Sep 2011 10:33:38 +0000 Subject: [PATCH] Fix default negative maxlengh in textbox --- .../client/plugins/widgets/TextBoxBaseWidgetFactory.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java index 50ffb209..af82d241 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TextBoxBaseWidgetFactory.java @@ -17,8 +17,7 @@ package com.google.gwt.query.client.plugins.widgets; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.InputElement; -import com.google.gwt.query.client.plugins.widgets.WidgetFactory; -import com.google.gwt.query.client.plugins.widgets.WidgetsUtils; +import com.google.gwt.query.client.GQuery; import com.google.gwt.user.client.ui.TextBoxBase; /** @@ -49,16 +48,15 @@ public abstract class TextBoxBaseWidgetFactory protected void copyAttributes(Element src, Element dest) { InputElement source = src.cast(); InputElement destination = dest.cast(); - + destination.setAccessKey(source.getAccessKey()); destination.setDefaultValue(source.getDefaultValue()); destination.setDisabled(source.isDisabled()); - destination.setMaxLength(source.getMaxLength()); + if (source.getMaxLength() > 0) destination.setMaxLength(source.getMaxLength()); destination.setReadOnly(source.isReadOnly()); destination.setSize(source.getSize()); destination.setName(source.getName()); destination.setValue(source.getValue()); - } protected abstract T createWidget(); -- 2.39.5