summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/VAADIN/themes/base/common/common.scss1
-rw-r--r--client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java4
-rw-r--r--uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java22
3 files changed, 26 insertions, 1 deletions
diff --git a/WebContent/VAADIN/themes/base/common/common.scss b/WebContent/VAADIN/themes/base/common/common.scss
index 27c6dc949c..926bdc7b74 100644
--- a/WebContent/VAADIN/themes/base/common/common.scss
+++ b/WebContent/VAADIN/themes/base/common/common.scss
@@ -240,6 +240,7 @@ input::-ms-clear {
.v-assistive-device-only {
position: absolute;
+ top: -2000px;
left: -2000px;
width: 10px;
overflow: hidden;
diff --git a/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java b/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
index ebfda2d715..7c2052e6f1 100644
--- a/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
+++ b/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
@@ -92,7 +92,9 @@ public class CheckBoxConnector extends AbstractFieldConnector implements
}
getWidget().setRequired(isRequired());
- getWidget().setEnabled(!isReadOnly());
+ if (isReadOnly()) {
+ getWidget().setEnabled(false);
+ }
if (getIcon() != null) {
if (getWidget().icon == null) {
diff --git a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java b/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java
index 4ffe7f806e..ec323f2db2 100644
--- a/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java
+++ b/uitest/src/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java
@@ -55,6 +55,7 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
addComponent(toggleIcon());
addComponent(toggleReadOnly());
addComponent(toggleInvalid());
+ addComponent(toggleEnabled());
addComponent(addCaptionText());
// layoutParent.addComponent(new
// NativeButton("Button right of layout"));
@@ -125,6 +126,21 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
return readOnlyToggle;
}
+ private Component toggleEnabled() {
+ CheckBox enabledToggle = new CheckBox();
+ enabledToggle.setImmediate(true);
+ enabledToggle.setValue(true);
+ enabledToggle.setCaption("Enabled");
+ enabledToggle.addValueChangeListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ setEnabled((Boolean) event.getProperty().getValue());
+ }
+ });
+
+ return enabledToggle;
+ }
+
private Component toggleInvalid() {
CheckBox invalid = new CheckBox("Invalid");
invalid.setImmediate(true);
@@ -174,6 +190,12 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
}
}
+ protected void setEnabled(boolean value) {
+ for (AbstractField<?> c : components) {
+ c.setEnabled(value);
+ }
+ }
+
private Component toggleError() {
CheckBox errorToggle = new CheckBox();
errorToggle.setImmediate(true);