fix(web): memoize skill sidebar menu offset

This commit is contained in:
yyh
2026-01-15 19:21:03 +08:00
parent ca7c4d2c86
commit b8adc8f498

View File

@ -65,6 +65,7 @@ const SidebarSearchAdd: FC = () => {
return 'root'
return getTargetFolderIdFromSelection(activeTabId, treeData.children)
}, [activeTabId, treeData?.children])
const menuOffset = useMemo(() => ({ mainAxis: 4 }), [])
const {
fileInputRef,
@ -91,7 +92,7 @@ const SidebarSearchAdd: FC = () => {
open={showMenu}
onOpenChange={setShowMenu}
placement="bottom-end"
offset={{ mainAxis: 4 }}
offset={menuOffset}
>
<PortalToFollowElemTrigger onClick={() => setShowMenu(!showMenu)}>
<Button