Skip to content

Commit dbbff28

Browse files
committed
Update events.js
1 parent a41f9ac commit dbbff28

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/utils/events.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ export const eventOnOff = (on, ...args) => {
4242
}
4343

4444
// Utility method to prevent the default event handling and propagation
45-
export const stopEvent = (evt, { propagation = true, immediatePropagation = false } = {}) => {
46-
evt.preventDefault()
45+
export const stopEvent = (
46+
evt,
47+
{ preventDefault = true, propagation = true, immediatePropagation = false } = {}
48+
) => {
49+
if (preventDefault) {
50+
evt.preventDefault()
51+
}
4752
if (propagation) {
4853
evt.stopPropagation()
4954
}

0 commit comments

Comments
 (0)