Skip to content

Commit

Permalink
fix(checkbox): set focusElement to input to avoid firefox issue (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Jan 10, 2019
1 parent 319a0a0 commit bcbd99b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vaadin-checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@
});
}

/** @protected */
get focusElement() {
return this.shadowRoot.querySelector('label');
return this.shadowRoot.querySelector('input');
}

/**
Expand Down
4 changes: 4 additions & 0 deletions test/vaadin-checkbox_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
expect(children[2].outerHTML).to.be.equal('<i>Checkbox</i>');
});

it('should have input as focusElement', () => {
expect(vaadinCheckbox.focusElement).to.be.eql(nativeCheckbox);
});

it('can be disabled imperatively', () => {
vaadinCheckbox.disabled = true;
expect(nativeCheckbox.hasAttribute('disabled')).to.be.eql(true);
Expand Down

0 comments on commit bcbd99b

Please sign in to comment.