Fixes #9731tags/8.4.5
@@ -90,6 +90,8 @@ public class ChildFocusAwareFlowPanel extends FocusableFlowPanel | |||
public ChildFocusAwareFlowPanel() { | |||
eventBus = new HandlerManager(this); | |||
getElement().getStyle().setOutlineStyle(OutlineStyle.NONE); | |||
// The panel itself should not be focused. | |||
getElement().setTabIndex(-1); | |||
super.addFocusHandler(handler); | |||
super.addBlurHandler(handler); | |||
} |
@@ -1,8 +1,12 @@ | |||
package com.vaadin.tests.components.checkboxgroup; | |||
import static org.junit.Assert.assertEquals; | |||
import static org.junit.Assert.assertTrue; | |||
import org.junit.Assert; | |||
import org.junit.Test; | |||
import org.openqa.selenium.Keys; | |||
import org.openqa.selenium.interactions.Actions; | |||
import com.vaadin.testbench.elements.ButtonElement; | |||
import com.vaadin.testbench.elements.CheckBoxGroupElement; | |||
@@ -27,4 +31,15 @@ public class CheckBoxGroupFocusTest extends FocusTest { | |||
assertTrue(isFocusInsideElement(checkBoxGroup)); | |||
} | |||
@Test | |||
public void focusDoesNotGoIntoWrapperElement() { | |||
openTestURL(); | |||
new Actions(getDriver()).sendKeys(Keys.TAB, Keys.TAB, Keys.TAB) | |||
.perform(); | |||
assertTrue("Focus not in the second check box group.", | |||
isFocusInsideElement($(CheckBoxGroupElement.class).last())); | |||
assertEquals("Focus should not be in the wrapping div.", "input", | |||
getFocusedElement().getTagName()); | |||
} | |||
} |
@@ -1,10 +1,15 @@ | |||
package com.vaadin.tests.components.radiobuttongroup; | |||
import static org.junit.Assert.assertEquals; | |||
import static org.junit.Assert.assertTrue; | |||
import org.junit.Assert; | |||
import org.junit.Test; | |||
import org.openqa.selenium.Keys; | |||
import org.openqa.selenium.interactions.Actions; | |||
import com.vaadin.testbench.elements.ButtonElement; | |||
import com.vaadin.testbench.elements.CheckBoxGroupElement; | |||
import com.vaadin.testbench.elements.RadioButtonGroupElement; | |||
import com.vaadin.tests.components.FocusTest; | |||
@@ -27,4 +32,13 @@ public class RadioButtonGroupFocusTest extends FocusTest { | |||
assertTrue(isFocusInsideElement(radioButtonGroup2)); | |||
} | |||
@Test | |||
public void focusDoesNotGoIntoWrapperElement() { | |||
openTestURL(); | |||
new Actions(getDriver()).sendKeys(Keys.TAB).perform(); | |||
assertTrue("Focus not in the second radio button group.", | |||
isFocusInsideElement($(RadioButtonGroupElement.class).last())); | |||
assertEquals("Focus should not be in the wrapping div.", "input", | |||
getFocusedElement().getTagName()); | |||
} | |||
} |