This commit is contained in:
17
node_modules/consolidated-events/src/normalizeEventOptions.js
generated
vendored
Normal file
17
node_modules/consolidated-events/src/normalizeEventOptions.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import canUsePassiveEventListeners from './canUsePassiveEventListeners';
|
||||
|
||||
export default function normalizeEventOptions(eventOptions) {
|
||||
if (!eventOptions) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (!canUsePassiveEventListeners()) {
|
||||
// If the browser does not support the passive option, then it is expecting
|
||||
// a boolean for the options argument to specify whether it should use
|
||||
// capture or not. In more modern browsers, this is passed via the `capture`
|
||||
// option, so let's just hoist that value up.
|
||||
return !!eventOptions.capture;
|
||||
}
|
||||
|
||||
return eventOptions;
|
||||
}
|
||||
Reference in New Issue
Block a user