compute node position

This commit is contained in:
StyleZhang
2024-02-27 18:02:29 +08:00
parent e92bc25216
commit a311f88c99
9 changed files with 203 additions and 35 deletions

View File

@ -59,6 +59,10 @@ const NodeSelector: FC<NodeSelectorProps> = ({
e.stopPropagation()
handleOpenChange(!open)
}, [open, handleOpenChange])
const handleSelect = useCallback((type: BlockEnum) => {
handleOpenChange(false)
onSelect(type)
}, [handleOpenChange, onSelect])
return (
<PortalToFollowElem
@ -99,7 +103,7 @@ const NodeSelector: FC<NodeSelectorProps> = ({
/>
</div>
</div>
<Tabs onSelect={onSelect} />
<Tabs onSelect={handleSelect} />
</div>
</PortalToFollowElemContent>
</PortalToFollowElem>