fix: Fixed performance regression in Super notes and improved toolbar (#2590)

This commit is contained in:
Aman Harwara
2023-10-17 22:49:19 +05:30
committed by GitHub
parent d254e1c4e3
commit 9e35e2eceb
45 changed files with 933 additions and 1034 deletions

View File

@@ -3,18 +3,7 @@ import { useEffect, useRef, useState } from 'react'
import { MutuallyExclusiveMediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery'
import { useApplication } from '../ApplicationProvider'
import { ApplicationEvent, PrefKey, PrefDefaults } from '@standardnotes/snjs'
function getScrollParent(node: HTMLElement | null): HTMLElement | null {
if (!node) {
return null
}
if (node.scrollHeight > node.clientHeight || node.scrollWidth > node.clientWidth) {
return node
} else {
return getScrollParent(node.parentElement)
}
}
import { getScrollParent } from '@/Utils'
const supportsPassive = (() => {
let supportsPassive = false