diff options
author | Henri Sara <henri.sara@itmill.com> | 2012-07-11 09:25:04 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2012-07-11 09:25:04 +0000 |
commit | 2738dca83648db5323652b4ac4c53d46eb6001c0 (patch) | |
tree | d64a9bf58a3a02e2fd0ebbc0b88f3575184f03ba /src | |
parent | 0376a920ad4a8576b7aa522ad493b510ee534334 (diff) | |
download | vaadin-framework-2738dca83648db5323652b4ac4c53d46eb6001c0.tar.gz vaadin-framework-2738dca83648db5323652b4ac4c53d46eb6001c0.zip |
#8230 #8917 Fix input prompt leaking to the field value in TextField and TextArea
svn changeset:24011/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTextField.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java index d1e4f7ca5b..b05b9ba830 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java @@ -433,7 +433,7 @@ public class VTextField extends TextBoxBase implements Paintable, Field, if (!prompting && newText != null && !newText.equals(valueBeforeEdit)) { sendValueChange = immediate; - client.updateVariable(id, "text", getText(), false); + client.updateVariable(id, "text", newText, false); valueBeforeEdit = newText; valueBeforeEditIsSynced = true; } @@ -500,6 +500,11 @@ public class VTextField extends TextBoxBase implements Paintable, Field, } public void onBlur(BlurEvent event) { + // this is called twice on Chrome when e.g. changing tab while prompting + // field focused - do not change settings on the second time + if (focusedTextField != this) { + return; + } removeStyleDependentName(CLASSNAME_FOCUS); focusedTextField = null; String text = getText(); |