Skip to content

Commit

Permalink
fix: set aria-checked properly when checked is null (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Ph authored Mar 18, 2020
1 parent 0b3b8e8 commit f8ebd2c
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 @@ -222,7 +222,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 f8ebd2c

Please sign in to comment.