From 7ede8a78466776351adf072a8df131c84c10badb Mon Sep 17 00:00:00 2001 From: Sergey Vinogradov Date: Sun, 19 Sep 2021 22:22:26 +0300 Subject: [PATCH] fix: delegate checked property to input --- packages/field-base/src/checked-mixin.js | 4 ++-- packages/field-base/test/checked-mixin.test.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/field-base/src/checked-mixin.js b/packages/field-base/src/checked-mixin.js index e4ce1c6ba1..d15b374435 100644 --- a/packages/field-base/src/checked-mixin.js +++ b/packages/field-base/src/checked-mixin.js @@ -25,8 +25,8 @@ const CheckedMixinImplementation = (superclass) => }; } - static get delegateAttrs() { - return [...super.delegateAttrs, 'checked']; + static get delegateProps() { + return [...super.delegateProps, 'checked']; } get _delegateStateTarget() { diff --git a/packages/field-base/test/checked-mixin.test.js b/packages/field-base/test/checked-mixin.test.js index aa3e2c305d..a7e778706b 100644 --- a/packages/field-base/test/checked-mixin.test.js +++ b/packages/field-base/test/checked-mixin.test.js @@ -84,17 +84,17 @@ describe('checked-mixin', () => { }); describe('delegation', () => { - describe('checked attribute', () => { + describe('checked property', () => { beforeEach(() => { element = fixtureSync(``); 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; }); }); });