chore: native-like draggable mobile menus (#2599)

This commit is contained in:
Aman Harwara
2023-10-23 19:27:52 +05:30
committed by GitHub
parent 3ece5868c1
commit a850d3c989
8 changed files with 373 additions and 231 deletions

View File

@@ -42,3 +42,19 @@ export const SuperEditorMetadata: EditorMetadata = {
iconClassName: 'text-accessory-tint-1',
iconTintNumber: 1,
}
export const SupportsPassiveListeners = (() => {
let supportsPassive = false
try {
const opts = Object.defineProperty({}, 'passive', {
get: () => {
supportsPassive = true
},
})
window.addEventListener('test', null as never, opts)
window.removeEventListener('test', null as never, opts)
} catch (e) {
/* empty */
}
return supportsPassive
})()