mirror of
https://github.com/logseq/logseq.git
synced 2026-05-24 12:44:22 +00:00
delay context bar width/height access
This commit is contained in:
@@ -40,10 +40,12 @@ const _ContextBar: TLContextBarComponent<Shape> = ({ shapes, offsets }) => {
|
||||
}, [])
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
const elm = rContextBar.current
|
||||
if (!elm) return
|
||||
const { offsetWidth, offsetHeight } = elm
|
||||
rSize.current = [offsetWidth, offsetHeight]
|
||||
setTimeout(() => {
|
||||
const elm = rContextBar.current
|
||||
if (!elm) return
|
||||
const { offsetWidth, offsetHeight } = elm
|
||||
rSize.current = [offsetWidth, offsetHeight]
|
||||
})
|
||||
})
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user