diff --git a/src/vaadin-checkbox.html b/src/vaadin-checkbox.html index bb73cda..5d8f2b4 100644 --- a/src/vaadin-checkbox.html +++ b/src/vaadin-checkbox.html @@ -222,7 +222,7 @@ if (this.indeterminate) { this.setAttribute('aria-checked', 'mixed'); } else { - this.setAttribute('aria-checked', checked); + this.setAttribute('aria-checked', Boolean(checked)); } } diff --git a/test/accessibility.html b/test/accessibility.html index fac8140..1535976 100644 --- a/test/accessibility.html +++ b/test/accessibility.html @@ -70,6 +70,10 @@ expect(vaadinCheckbox.getAttribute('aria-checked')).to.be.eql('mixed'); }); + it('should set aria-checked to "false" when checked is set to null', () => { + vaadinCheckbox.checked = null; + expect(vaadinCheckbox.getAttribute('aria-checked')).to.eql('false'); + }); }); });