From b77a038d5f3feec934d1d81aba7ac2ca150a9d0e Mon Sep 17 00:00:00 2001 From: Thijs Louisse Date: Tue, 13 Apr 2021 00:31:17 +0200 Subject: [PATCH] fix(checkbox-group): recover possibility to registrer without [] --- .changeset/lemon-shoes-doubt.md | 5 +++++ packages/checkbox-group/src/LionCheckboxGroup.js | 8 -------- .../checkbox-group/test/lion-checkbox-group.test.js | 13 ------------- 3 files changed, 5 insertions(+), 21 deletions(-) create mode 100644 .changeset/lemon-shoes-doubt.md diff --git a/.changeset/lemon-shoes-doubt.md b/.changeset/lemon-shoes-doubt.md new file mode 100644 index 000000000..34734d30b --- /dev/null +++ b/.changeset/lemon-shoes-doubt.md @@ -0,0 +1,5 @@ +--- +'@lion/checkbox-group': patch +--- + +recover possibility to registrer without [] diff --git a/packages/checkbox-group/src/LionCheckboxGroup.js b/packages/checkbox-group/src/LionCheckboxGroup.js index 6ad4b89f2..22cf96a7b 100644 --- a/packages/checkbox-group/src/LionCheckboxGroup.js +++ b/packages/checkbox-group/src/LionCheckboxGroup.js @@ -9,12 +9,4 @@ export class LionCheckboxGroup extends ChoiceGroupMixin(FormGroupMixin(LitElemen super(); this.multipleChoice = true; } - - /** @param {import('@lion/core').PropertyValues } changedProperties */ - updated(changedProperties) { - super.updated(changedProperties); - if (changedProperties.has('name') && !String(this.name).match(/\[\]$/)) { - throw new Error('Names should end in "[]".'); - } - } } diff --git a/packages/checkbox-group/test/lion-checkbox-group.test.js b/packages/checkbox-group/test/lion-checkbox-group.test.js index 847128a60..5483f756c 100644 --- a/packages/checkbox-group/test/lion-checkbox-group.test.js +++ b/packages/checkbox-group/test/lion-checkbox-group.test.js @@ -104,17 +104,4 @@ describe('', () => { `); await expect(el).to.be.accessible(); }); - - it("should throw exception if name doesn't end in []", async () => { - const el = await fixture(html``); - el.name = 'woof'; - let err; - try { - await el.updateComplete; - } catch (e) { - err = e; - } - expect(err).to.be.an.instanceof(Error); - expect(err.message).to.equal('Names should end in "[]".'); - }); });