Skip to content

Commit

Permalink
fix: passed the event to the close method
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandrshy committed Jul 5, 2020
1 parent 69b63ae commit 0ebe2eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Expand Up @@ -161,7 +161,7 @@ export const Keukenhof = ((): KeukenhofType => {
* @param {object} event - Event data
*/
onClick(event: Event) {
if ((event.target as Element).closest(`[${this.closeAttribute}]`)) this.close();
if ((event.target as Element).closest(`[${this.closeAttribute}]`)) this.close(event);
}

/**
Expand All @@ -170,7 +170,7 @@ export const Keukenhof = ((): KeukenhofType => {
* @param {KeyboardEvent} event - Event data
*/
onKeyup(event: KeyboardEvent) {
if (event.key === KEY.ESCAPE || event.key === KEY.ESC) this.close();
if (event.key === KEY.ESCAPE || event.key === KEY.ESC) this.close(event);
}

/**
Expand Down

0 comments on commit 0ebe2eb

Please sign in to comment.