Merge pull request #2 from TroyeJames9/fix-popver_id

fix(popover): Modify Popover ID generation
This commit is contained in:
TroyeJames9 2025-08-15 12:26:32 +08:00 committed by GitHub
commit d5cc7fc608
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,7 +43,9 @@ async function mouseEnterHandler(
const hash = decodeURIComponent(targetUrl.hash)
targetUrl.hash = ""
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)
// dont refetch if there's already a popover