fix: resolve chat sidebar UI bugs for hover panel and dropdown menu (#25813)

This commit is contained in:
lyzno1
2025-09-19 18:28:49 +08:00
committed by GitHub
parent ab910c736c
commit e93bfe3d41
5 changed files with 47 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
'use client'
import type { FC } from 'react'
import React, { useCallback, useRef, useState } from 'react'
import React, { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import type { Placement } from '@floating-ui/react'
import {
@@ -25,12 +25,14 @@ type Props = {
data?: SiteInfo
placement?: Placement
hideLogout?: boolean
forceClose?: boolean
}
const MenuDropdown: FC<Props> = ({
data,
placement,
hideLogout,
forceClose,
}) => {
const webAppAccessMode = useWebAppStore(s => s.webAppAccessMode)
const router = useRouter()
@@ -55,6 +57,11 @@ const MenuDropdown: FC<Props> = ({
const [show, setShow] = useState(false)
useEffect(() => {
if (forceClose)
setOpen(false)
}, [forceClose, setOpen])
return (
<>
<PortalToFollowElem