Skip to content

Commit

Permalink
fix: set aria-checked properly when checked is null (#165)
Browse files Browse the repository at this point in the history
Co-authored-by: Phan Hong Duc <[email protected]>
  • Loading branch information
web-padawan and Harry-Ph authored Mar 19, 2020
1 parent 35977f5 commit ee07e8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/vaadin-checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
if (this.indeterminate) {
this.setAttribute('aria-checked', 'mixed');
} else {
this.setAttribute('aria-checked', checked);
this.setAttribute('aria-checked', Boolean(checked));
}
}

Expand Down
4 changes: 4 additions & 0 deletions test/accessibility.html
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

});
Expand Down

0 comments on commit ee07e8c

Please sign in to comment.