diff --git a/packages/button/src/LionButton.js b/packages/button/src/LionButton.js index 347419f268..37749a05a3 100644 --- a/packages/button/src/LionButton.js +++ b/packages/button/src/LionButton.js @@ -155,7 +155,7 @@ export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) { __clickDelegationHandler(e) { e.stopPropagation(); // prevent click on the fake element and cause click on the native button - this.$$slot('_button').click(); + this.__dispatchClickOnNativeButton(); } __setupDelegation() { @@ -181,10 +181,16 @@ export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) { if (e.keyCode === 32 /* space */ || e.keyCode === 13 /* enter */) { e.preventDefault(); this.shadowRoot.querySelector('.btn').removeAttribute('active'); - this.$$slot('_button').click(); + this.__dispatchClickOnNativeButton(); } } + __dispatchClickOnNativeButton() { + this.$$slot('_button').dispatchEvent( + new MouseEvent('click', { bubbles: true, composed: true }), + ); + } + __onDisabledChanged() { if (this.disabled) { this.__originalTabIndex = this.tabindex;