fix: anchor name in popover and tooltip (#194)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Wesley Luyten
2025-11-13 19:35:55 -06:00
committed by GitHub
co-authored by Copilot
parent d7720a3786
commit d9658582f1
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -268,7 +268,7 @@ function PopoverPopup({ id, className, children }: PopoverPopupProps): JSX.Eleme
const triggerElement = triggerRef.current;
const uniqueId = useId();
const popupId = id ?? uniqueId;
const popupId = id ?? uniqueId.replace(/^:([^:]+):$/, '«$1»');
useEffect(() => {
if (!popupRef.current || !triggerRef.current) return;
+1 -1
View File
@@ -309,7 +309,7 @@ function TooltipPopup({ id, className = '', children }: TooltipPopupProps): JSX.
const triggerElement = triggerRef.current;
const uniqueId = useId();
const popupId = id ?? uniqueId;
const popupId = id ?? uniqueId.replace(/^:([^:]+):$/, '«$1»');
useEffect(() => {
if (!popupRef.current || !triggerRef.current) return;
+9
View File
@@ -2,3 +2,12 @@ declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}
declare global {
declare module 'react' {
interface Attributes {
popover?: 'auto' | 'manual' | string;
commandfor?: string;
}
}
}