Skip to content

Commit

Permalink
fix: allow events preventDefault & stopPropagation
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejcodes committed Aug 11, 2023
1 parent 9a5078c commit 043af20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/minze/src/lib/minze-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ export class MinzeElement extends HTMLElement {

elements?.forEach((element: Node | MinzeElement | typeof window) => {
action === 'add'
? element.addEventListener(eventName, callback, true)
: element.removeEventListener(eventName, callback, true)
? element.addEventListener(eventName, callback)
: element.removeEventListener(eventName, callback)
})
}

Expand Down
4 changes: 2 additions & 2 deletions packages/minze/src/lib/minze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class Minze {
* ```
*/
static listen(eventName: string, callback: (event: Event) => void) {
addEventListener(eventName, callback, true)
addEventListener(eventName, callback)
}

/**
Expand All @@ -201,6 +201,6 @@ export class Minze {
* ```
*/
static stopListen(eventName: string, callback: (event: Event) => void) {
removeEventListener(eventName, callback, true)
removeEventListener(eventName, callback)
}
}

0 comments on commit 043af20

Please sign in to comment.