mirror of https://github.com/logseq/logseq
delay context bar width/height access
parent
ac27e5e6f8
commit
6ed07eaef0
|
@ -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(() => {
|
||||
|
|
Loading…
Reference in New Issue