mirror of
https://github.com/zoriya/v10.git
synced 2026-08-05 05:37:21 +00:00
fix: anchor name in popover and tooltip (#194)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Vendored
+9
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user