summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-07-26 13:19:35 +0300
committerHenri Sara <henri.sara@gmail.com>2017-07-26 13:19:35 +0300
commitf106026e41c667a4013031f59b0416532fd877bc (patch)
tree155d32aff572a3c21732366ddc0dca34104bbcd0 /client
parentf38da154c1e6f5706c95e7bbc1468d47a0a65104 (diff)
downloadvaadin-framework-f106026e41c667a4013031f59b0416532fd877bc.tar.gz
vaadin-framework-f106026e41c667a4013031f59b0416532fd877bc.zip
Send cursor position to server on blur even if the value has not changed (#9728)
Fixes #9653
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java b/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java
index 23d76d0717..d5a1295f95 100644
--- a/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/textfield/AbstractTextFieldConnector.java
@@ -15,6 +15,7 @@
*/
package com.vaadin.client.ui.textfield;
+import com.google.gwt.event.dom.client.HasBlurHandlers;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.DeferredWorker;
import com.vaadin.client.annotations.OnStateChange;
@@ -28,7 +29,7 @@ import com.vaadin.ui.AbstractTextField;
/**
* Connector class for AbstractTextField.
- *
+ *
* @since 8.0
*/
public abstract class AbstractTextFieldConnector extends AbstractFieldConnector
@@ -70,6 +71,13 @@ public abstract class AbstractTextFieldConnector extends AbstractFieldConnector
new AbstractTextFieldClientRpcImpl());
ConnectorFocusAndBlurHandler.addHandlers(this);
valueChangeHandler = new ValueChangeHandler(this);
+
+ // Ensures that the cursor position is sent when leaving the field
+ // (if it has changed)
+ if (getWidget() instanceof HasBlurHandlers) {
+ ((HasBlurHandlers) getWidget())
+ .addBlurHandler(event -> sendValueChange());
+ }
}
protected ValueChangeHandler getValueChangeHandler() {