react-dnd-touch-backend
Version:
Touch backend for react-dnd
22 lines (21 loc) • 342 B
text/typescript
export const supportsPassive = ((): boolean => {
// simular to jQuery's test
let supported = false
try {
addEventListener(
'test',
() => {
// do nothing
},
Object.defineProperty({}, 'passive', {
get() {
supported = true
return true
},
}),
)
} catch (e) {
// do nothing
}
return supported
})()