[Bug] Fix selection toolbox position on pasted node (#3231)

This commit is contained in:
Chenlei Hu
2025-03-25 10:51:04 -04:00
committed by GitHub
parent 24dcaa7f72
commit d3c64d404b
2 changed files with 28 additions and 2 deletions

View File

@@ -52,8 +52,11 @@ watch(
(canvas: LGraphCanvas | null) => {
if (!canvas) return
canvas.onSelectionChange = useChainCallback(canvas.onSelectionChange, () =>
positionSelectionOverlay(canvas)
canvas.onSelectionChange = useChainCallback(
canvas.onSelectionChange,
// Wait for next frame as sometimes the selected items haven't been
// rendered yet, so the boundingRect is not available on them.
() => requestAnimationFrame(() => positionSelectionOverlay(canvas))
)
},
{ immediate: true }