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

@@ -243,3 +243,15 @@ export const getBlobFromBase64 = (b64Data: string, contentType = '', sliceSize =
const blob = new Blob(byteArrays, { type: contentType })
return blob
}
export 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)
}
}