]> source.dussan.org Git - vaadin-framework.git/commitdiff
Set focus when click on RadioButton via JS. (#8062)
authorrogozinds <rogozinds@gmail.com>
Wed, 21 Dec 2016 06:06:31 +0000 (22:06 -0800)
committerHenri Sara <henri.sara@gmail.com>
Wed, 21 Dec 2016 06:06:31 +0000 (08:06 +0200)
Sending click even in JS to a RadioButton in RadioButtonGroup doesn't
trigger focus event for RadioButtonGroup in IE11. Fix it.
Same fix for CheckBoxGroup.

client/src/main/java/com/vaadin/client/ui/VCheckBoxGroup.java
client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java

index d6b8c3ade91c10a4cdaf06a0d6a6252cca27c741..ee1d83ee2c20ebc8eb0e35608f4ccdcca0435372 100644 (file)
@@ -29,6 +29,7 @@ import com.google.gwt.user.client.ui.FocusWidget;
 import com.google.gwt.user.client.ui.HasEnabled;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.ApplicationConnection;
+import com.vaadin.client.BrowserInfo;
 import com.vaadin.client.WidgetUtil;
 import com.vaadin.client.widgets.FocusableFlowPanelComposite;
 import com.vaadin.shared.Registration;
@@ -134,7 +135,11 @@ public class VCheckBoxGroup extends FocusableFlowPanelComposite
                 // checkbox is disabled
                 return;
             }
-
+            if (BrowserInfo.get().isWebkit() || BrowserInfo.get().isIE11()) {
+                // Webkit does not focus non-text input elements on click
+                // (#11854)
+                source.setFocus(true);
+            }
             Boolean selected = source.getValue();
 
             JsonObject item = optionsToItems.get(source);
index fe5afea6208dadb8686ee382f220019f336e0771..7cfaf7572e74021b041db0388a4030a49ad54672 100644 (file)
@@ -152,7 +152,7 @@ public class VRadioButtonGroup extends FocusableFlowPanelComposite
                 // radiobutton is disabled
                 return;
             }
-            if (BrowserInfo.get().isWebkit()) {
+            if (BrowserInfo.get().isWebkit() || BrowserInfo.get().isIE11()) {
                 // Webkit does not focus non-text input elements on click
                 // (#11854)
                 source.setFocus(true);