@goji/core
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -25,4 +25,8 @@ "use strict"; | ||
triggerEvent(e) { | ||
var _a; | ||
processingEventBeforeDispatch(e); | ||
const { currentTarget, timeStamp } = e; | ||
const { currentTarget, timeStamp, timestamp } = e; | ||
// some events, like 'input' of `textarea`, use `timestamp` instead of `timeStamp` | ||
// https://github.com/airbnb/goji-js/issues/208 | ||
const fixedTimeStamp = (_a = timeStamp !== null && timeStamp !== void 0 ? timeStamp : timestamp) !== null && _a !== void 0 ? _a : undefined; | ||
const id = currentTarget.dataset.gojiId; | ||
@@ -35,5 +39,5 @@ const type = (0, camelCase_1.default)(`on-${(e.type || '').toLowerCase()}`); | ||
e.stopPropagation = () => { | ||
instance.stopPropagation(type, timeStamp !== null && timeStamp !== void 0 ? timeStamp : undefined); | ||
instance.stopPropagation(type, fixedTimeStamp); | ||
}; | ||
instance.triggerEvent(type, timeStamp !== null && timeStamp !== void 0 ? timeStamp : undefined, e); | ||
instance.triggerEvent(type, fixedTimeStamp, e); | ||
} | ||
@@ -40,0 +44,0 @@ } |
@@ -21,4 +21,8 @@ import camelCase from 'lodash/camelCase'; | ||
triggerEvent(e) { | ||
var _a; | ||
processingEventBeforeDispatch(e); | ||
const { currentTarget, timeStamp } = e; | ||
const { currentTarget, timeStamp, timestamp } = e; | ||
// some events, like 'input' of `textarea`, use `timestamp` instead of `timeStamp` | ||
// https://github.com/airbnb/goji-js/issues/208 | ||
const fixedTimeStamp = (_a = timeStamp !== null && timeStamp !== void 0 ? timeStamp : timestamp) !== null && _a !== void 0 ? _a : undefined; | ||
const id = currentTarget.dataset.gojiId; | ||
@@ -31,5 +35,5 @@ const type = camelCase(`on-${(e.type || '').toLowerCase()}`); | ||
e.stopPropagation = () => { | ||
instance.stopPropagation(type, timeStamp !== null && timeStamp !== void 0 ? timeStamp : undefined); | ||
instance.stopPropagation(type, fixedTimeStamp); | ||
}; | ||
instance.triggerEvent(type, timeStamp !== null && timeStamp !== void 0 ? timeStamp : undefined, e); | ||
instance.triggerEvent(type, fixedTimeStamp, e); | ||
} | ||
@@ -36,0 +40,0 @@ } |
{ | ||
"name": "@goji/core", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "GojiJS Core", | ||
@@ -55,3 +55,3 @@ "main": "dist/cjs/index.js", | ||
}, | ||
"gitHead": "767c49b6394029c27de14b5b5128f0d0396aa9d1" | ||
"gitHead": "17ce8e45566bd0c67c5597368010fe9a4b2eb405" | ||
} |
@@ -26,3 +26,8 @@ import camelCase from 'lodash/camelCase'; | ||
processingEventBeforeDispatch(e); | ||
const { currentTarget, timeStamp } = e; | ||
const { currentTarget, timeStamp, timestamp } = e; | ||
// some events, like 'input' of `textarea`, use `timestamp` instead of `timeStamp` | ||
// https://github.com/airbnb/goji-js/issues/208 | ||
const fixedTimeStamp = timeStamp ?? timestamp ?? undefined; | ||
const id = currentTarget.dataset.gojiId; | ||
@@ -37,6 +42,6 @@ const type = camelCase(`on-${(e.type || '').toLowerCase()}`); | ||
e.stopPropagation = () => { | ||
instance.stopPropagation(type, timeStamp ?? undefined); | ||
instance.stopPropagation(type, fixedTimeStamp); | ||
}; | ||
instance.triggerEvent(type, timeStamp ?? undefined, e); | ||
instance.triggerEvent(type, fixedTimeStamp, e); | ||
} | ||
@@ -43,0 +48,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
771307
13626