From b06372676c60d8cafaacf6671b3534c2be414cfa Mon Sep 17 00:00:00 2001 From: Boris Diakur Date: Tue, 16 Nov 2021 18:44:30 +0100 Subject: [PATCH] fix(ld-radio): remove redundant input event dispatch --- src/liquid/components/ld-radio/ld-radio.tsx | 3 +-- .../components/ld-radio/test/ld-radio.spec.ts | 14 -------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/liquid/components/ld-radio/ld-radio.tsx b/src/liquid/components/ld-radio/ld-radio.tsx index 605460b1a7..ef1626977e 100644 --- a/src/liquid/components/ld-radio/ld-radio.tsx +++ b/src/liquid/components/ld-radio/ld-radio.tsx @@ -120,7 +120,6 @@ export class LdRadio implements InnerFocusable { } this.checked = true - this.el.dispatchEvent(new Event('input', { bubbles: true, composed: true })) } private focusAndSelect(dir: 'next' | 'prev') { @@ -128,7 +127,7 @@ export class LdRadio implements InnerFocusable { (ldRadio) => ldRadio.getAttribute('name') === this.name ) ldRadios.forEach((ldRadio, index) => { - if (ldRadio === ((this.el as unknown) as HTMLLdRadioElement)) { + if (ldRadio === (this.el as unknown as HTMLLdRadioElement)) { const targetLdRadio = ldRadios[index + (dir === 'next' ? 1 : -1)] if (targetLdRadio) { targetLdRadio.focusInner() diff --git a/src/liquid/components/ld-radio/test/ld-radio.spec.ts b/src/liquid/components/ld-radio/test/ld-radio.spec.ts index f40868b088..f5f9794a4f 100644 --- a/src/liquid/components/ld-radio/test/ld-radio.spec.ts +++ b/src/liquid/components/ld-radio/test/ld-radio.spec.ts @@ -90,20 +90,6 @@ describe('ld-radio', () => { expect(spyBlur).toHaveBeenCalled() }) - it('emits input event on click', async () => { - const page = await newSpecPage({ - components: [LdRadio], - html: ``, - }) - const ldRadio = page.root - - const spyInput = jest.fn() - ldRadio.addEventListener('input', spyInput) - ldRadio.click() - - expect(spyInput).toHaveBeenCalled() - }) - it('allows to set inner focus', async () => { const page = await newSpecPage({ components: [LdRadio],