fix(popover): Modify Popover ID generation

Signed-off-by: TroyeJames9 <130838331+TroyeJames9@users.noreply.github.com>
This commit is contained in:
TroyeJames9 2025-08-15 11:38:29 +08:00
parent e918f11652
commit 5fa4994408

View File

@ -43,7 +43,9 @@ async function mouseEnterHandler(
const hash = decodeURIComponent(targetUrl.hash) const hash = decodeURIComponent(targetUrl.hash)
targetUrl.hash = "" targetUrl.hash = ""
targetUrl.search = "" targetUrl.search = ""
const popoverId = `popover-${link.pathname}`
// use the full path + encoded hash as the unique identifier
const popoverId = `popover-${targetUrl.pathname}${hash.replace(/#/g, '-')}`
const prevPopoverElement = document.getElementById(popoverId) const prevPopoverElement = document.getElementById(popoverId)
// dont refetch if there's already a popover // dont refetch if there's already a popover