Skip to content

Commit

Permalink
fix(checkbox): add missing styles for hidden attribute (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Dec 18, 2018
1 parent c6a237d commit 4267426
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vaadin-checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
display: inline-block;
}

:host([hidden]) {
display: none !important;
}

label {
display: inline-flex;
align-items: baseline;
Expand Down
5 changes: 5 additions & 0 deletions test/vaadin-checkbox_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
expect(vaadinCheckbox.name).to.eq('test-checkbox');
});

it('should have display: none when hidden', () => {
vaadinCheckbox.setAttribute('hidden', '');
expect(getComputedStyle(vaadinCheckbox).display).to.equal('none');
});

it('should toggle on host click', () => {
vaadinCheckbox.click();

Expand Down

0 comments on commit 4267426

Please sign in to comment.