Skip to content

Commit

Permalink
fix: delegate checked property to input
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Sep 19, 2021
1 parent 4e73052 commit 7ede8a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/field-base/src/checked-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const CheckedMixinImplementation = (superclass) =>
};
}

static get delegateAttrs() {
return [...super.delegateAttrs, 'checked'];
static get delegateProps() {
return [...super.delegateProps, 'checked'];
}

get _delegateStateTarget() {
Expand Down
10 changes: 5 additions & 5 deletions packages/field-base/test/checked-mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ describe('checked-mixin', () => {
});

describe('delegation', () => {
describe('checked attribute', () => {
describe('checked property', () => {
beforeEach(() => {
element = fixtureSync(`<checked-mixin-element checked></checked-mixin-element>`);
input = element.querySelector('[slot=input]');
});

it('should delegate checked attribute to the input', () => {
expect(input.hasAttribute('checked')).to.be.true;
it('should delegate checked property to the input', () => {
expect(input.checked).to.be.true;

element.removeAttribute('checked');
expect(input.hasAttribute('checked')).to.be.false;
element.checked = false;
expect(input.checked).to.be.false;
});
});
});
Expand Down

0 comments on commit 7ede8a7

Please sign in to comment.