Don't sanitize. That's not the role here.
This commit is contained in:
parent
1b0175d237
commit
1300129ecc
@ -1,6 +1,6 @@
|
||||
import { isFunction } from 'trimkit';
|
||||
|
||||
import { sanitizeObject, supportsPassive } from './utils.js';
|
||||
import { supportsPassive } from './utils.js';
|
||||
|
||||
const OVERRIDING_EVENTS = ['contextmenu', 'dragover', 'drop'];
|
||||
function getEventList(element) {
|
||||
@ -20,12 +20,7 @@ export function Projector(domRoot) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
const fakeEvt = sanitizeObject(evt);
|
||||
if (evt.target) {
|
||||
fakeEvt.target = evt.target._id;
|
||||
}
|
||||
|
||||
eventCallbacks.forEach(cb => cb(fakeEvt));
|
||||
eventCallbacks.forEach(cb => cb(evt));
|
||||
}
|
||||
function removeEvent(eventSet, id, eventName) {
|
||||
eventSet.remove(element._id);
|
||||
|
||||
@ -1,16 +1,3 @@
|
||||
export const NORMAL_OBJECT_PROP_TYPES = ['number', 'string', 'boolean'];
|
||||
|
||||
export function sanitizeObject(obj) {
|
||||
const output = {};
|
||||
for (const key in evt) {
|
||||
const value = evt[key];
|
||||
if (NORMAL_OBJECT_PROP_TYPES.includes(typeof value)) {
|
||||
output[key] = value;
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
// Extrapolated from https://github.com/zzarcon/default-passive-events/blob/master/default-passive-events.js
|
||||
export let supportsPassive = false;
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user