diff --git a/src/components/drawer/bl-drawer.ts b/src/components/drawer/bl-drawer.ts index 67e80900e..47c403c95 100644 --- a/src/components/drawer/bl-drawer.ts +++ b/src/components/drawer/bl-drawer.ts @@ -74,16 +74,14 @@ export default class BlDrawer extends LitElement { } this.domExistence = true; - // 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 5e1465f9b..16533067c 100644 --- a/src/components/popover/bl-popover.ts +++ b/src/components/popover/bl-popover.ts @@ -193,7 +193,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); @@ -207,7 +207,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 92b62f0f8..d40d36672 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 d4f884016..5115b24b0 100644 --- a/src/components/tooltip/bl-tooltip.ts +++ b/src/components/tooltip/bl-tooltip.ts @@ -46,7 +46,7 @@ export default class BlTooltip extends LitElement { show() { this.popover.target = this.trigger; this.popover.show(); - this.onShow(""); + this.onShow(); } /** @@ -54,7 +54,7 @@ export default class BlTooltip extends LitElement { */ hide() { this.popover.hide(); - this.onHide(""); + this.onHide(); } /** @@ -83,7 +83,7 @@ export default class BlTooltip extends LitElement { diff --git a/src/utilities/event.ts b/src/utilities/event.ts index 52723b3b5..129582278 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,