Skip to content

Commit 97609b1

Browse files
committed
feat: add 'stopPropagation' and 'preventDefault' to 'CONFIG' options
1 parent cb82abc commit 97609b1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

js-css-animations/animate.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const configurations = {
3737
widthTransition: undefined,
3838
heightTransition: undefined,
3939
overflowHidden: true,
40+
stopPropagation: true,
41+
preventDefault: true,
4042
}),
4143
};
4244

@@ -45,7 +47,7 @@ const configurations = {
4547
* if an option is not customized by the user, the default value set
4648
* in 'configurations.default' will be returned instead.
4749
* @see {@link CONFIG}
48-
* @see {@link module:animate~configurations}
50+
* @see {@link configurations}
4951
*/
5052
const configHandler = {
5153
/**
@@ -71,7 +73,7 @@ const configHandler = {
7173
* Object that handles configurations, either customized by the user
7274
* or default values defined in 'configurations.default' object
7375
* @type {Object.<string,any>}
74-
* @see {@link module:animate~configurations}
76+
* @see {@link configurations}
7577
*/
7678
const CONFIG = new Proxy(configurations, configHandler);
7779

@@ -570,7 +572,10 @@ const preset = (el, args) => {
570572
*/
571573
const eventHandler = (el, animationId, opts) => {
572574
return (/** @type {Event} */ e) => {
573-
const { stopPropagation = true, preventDefault = true } = opts;
575+
const {
576+
stopPropagation = CONFIG.stopPropagation,
577+
preventDefault = CONFIG.preventDefault,
578+
} = opts;
574579
if (stopPropagation) e.stopPropagation();
575580
if (preventDefault) e.preventDefault();
576581

0 commit comments

Comments
 (0)