summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/gwt/client/Util.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/Util.java')
-rw-r--r--src/com/vaadin/terminal/gwt/client/Util.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java
index bfe63caefd..c392a0ba9c 100644
--- a/src/com/vaadin/terminal/gwt/client/Util.java
+++ b/src/com/vaadin/terminal/gwt/client/Util.java
@@ -978,6 +978,19 @@ public class Util {
*/
final Element target = getElementFromPoint(touch.getClientX(),
touch.getClientY());
+
+ /*
+ * Fixes infocusable form fields in Safari of iOS 5.x and some Android
+ * browsers.
+ */
+ Widget targetWidget = findWidget(target, null);
+ if (targetWidget instanceof com.google.gwt.user.client.ui.Focusable) {
+ final com.google.gwt.user.client.ui.Focusable toBeFocusedWidget = (com.google.gwt.user.client.ui.Focusable) targetWidget;
+ toBeFocusedWidget.setFocus(true);
+ } else if (targetWidget instanceof Focusable) {
+ ((Focusable) targetWidget).focus();
+ }
+
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
try {