diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-04-25 11:54:50 +0000 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-04-25 11:54:50 +0000 |
commit | 5de2ea4ca26b93d635fdc828c8da991907a7c8eb (patch) | |
tree | c38c9eb95dc1a58f26fee433c1318b751995e622 /src/com | |
parent | 4e795bc38ff7ee8a41bd3885eea9ce5de2c281f1 (diff) | |
download | vaadin-framework-5de2ea4ca26b93d635fdc828c8da991907a7c8eb.tar.gz vaadin-framework-5de2ea4ca26b93d635fdc828c8da991907a7c8eb.zip |
Explicitly focus widget when simulating click (#8659)
svn changeset:23628/svn branch:6.8
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/Util.java | 13 |
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 b9baf362e4..cb2539daa5 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -1223,6 +1223,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 { |