diff --git a/src/components/drawer/bl-drawer.ts b/src/components/drawer/bl-drawer.ts index 32a04348..26dc336a 100644 --- a/src/components/drawer/bl-drawer.ts +++ b/src/components/drawer/bl-drawer.ts @@ -111,21 +111,21 @@ export default class BlDrawer extends LitElement { clearTimeout(this.domExistenceSchedule); } this.domExistence = true; + window.setTimeout(() => { if (this.embedUrl && this._drawerIframe) { this._drawerIframe.src = this.embedUrl; } }); // FIXME: Allow events without payload - this.onOpen(""); + this.onOpen(); } else { // Give some time for exit animation this.domExistenceSchedule = window.setTimeout(() => { this.domExistence = false; }, 1000); - // FIXME: Allow events without payload - this.onClose(""); + this.onClose(); } } diff --git a/src/components/popover/bl-popover.ts b/src/components/popover/bl-popover.ts index a783e1f2..74326fdb 100644 --- a/src/components/popover/bl-popover.ts +++ b/src/components/popover/bl-popover.ts @@ -195,7 +195,7 @@ export default class BlPopover extends LitElement { show() { this._visible = true; this.setPopover(); - this.onBlPopoverShow(""); + this.onBlPopoverShow(); document.addEventListener("click", this._handleClickOutside); document.addEventListener("keydown", this._handleKeydownEvent); document.addEventListener("bl-popover-show", this._handlePopoverShowEvent); @@ -209,7 +209,7 @@ export default class BlPopover extends LitElement { document.removeEventListener("click", this._handleClickOutside); document.removeEventListener("keydown", this._handleKeydownEvent); document.removeEventListener("bl-popover-show", this._handlePopoverShowEvent); - this.onBlPopoverHide(""); + this.onBlPopoverHide(); } /** diff --git a/src/components/tooltip/bl-tooltip.test.ts b/src/components/tooltip/bl-tooltip.test.ts index 55add7bc..f170c276 100644 --- a/src/components/tooltip/bl-tooltip.test.ts +++ b/src/components/tooltip/bl-tooltip.test.ts @@ -144,7 +144,7 @@ describe("bl-tooltip", () => { const ev = await oneEvent(el, "bl-tooltip-show"); expect(ev).to.exist; - expect(ev.detail).to.be.equal(""); + expect(ev.detail).to.be.null; }); it("should fires bl-tooltip-hide on mouse leave", async () => { @@ -169,7 +169,7 @@ describe("bl-tooltip", () => { const ev = await oneEvent(el, "bl-tooltip-hide"); expect(ev).to.exist; - expect(ev.detail).to.be.equal(""); + expect(ev.detail).to.be.null; }); it("should show/hide with focus and blur events", async () => { diff --git a/src/components/tooltip/bl-tooltip.ts b/src/components/tooltip/bl-tooltip.ts index e2bbe22e..7e255253 100644 --- a/src/components/tooltip/bl-tooltip.ts +++ b/src/components/tooltip/bl-tooltip.ts @@ -97,17 +97,19 @@ export default class BlTooltip extends LitElement { * Shows tooltip */ show() { - this._popover.target = this.target ?? this.trigger; - this._popover.show(); - this.onShow(""); + + this._popover.target = this.target ?? this.trigger; + this._popover.show(); + this.onShow(); } /** * Hides tooltip */ hide() { - this._popover.hide(); - this.onHide(""); + + this._popover.hide(); + this.onHide(); } /** @@ -136,7 +138,7 @@ export default class BlTooltip extends LitElement { diff --git a/src/utilities/event.ts b/src/utilities/event.ts index 52723b3b..12958227 100644 --- a/src/utilities/event.ts +++ b/src/utilities/event.ts @@ -5,11 +5,11 @@ export interface EventOptions { } export interface EventDispatcher { - (value: T, options?: EventOptions): CustomEvent; + (value?: T, options?: EventOptions): CustomEvent; } function dispatcher(target: HTMLElement, eventName: string): EventDispatcher { - return function (value: T, options?: EventOptions) { + return function (value?: T, options?: EventOptions) { const customEvent = new CustomEvent(eventName, { detail: value, bubbles: true,