refactor: popover a11y aria attributes

This commit is contained in:
Aman Harwara
2023-08-14 14:42:33 +05:30
parent e1c5d52dbe
commit 4865e3ba28
31 changed files with 110 additions and 88 deletions

View File

@@ -8,6 +8,7 @@ import {
MouseEventHandler,
ReactNode,
useCallback,
useRef,
useState,
} from 'react'
import Icon from '../Icon/Icon'
@@ -27,12 +28,12 @@ const Tooltip = ({ text }: { text: string }) => {
[visible],
)
const [anchorElement, setAnchorElement] = useState<HTMLDivElement | null>(null)
const anchorElement = useRef(null)
return (
<div className="relative">
<div
ref={setAnchorElement}
ref={anchorElement}
className={classNames('peer z-0 flex h-5 w-5 items-center justify-center rounded-full')}
onClick={onClickMobile}
onMouseEnter={() => setVisible(true)}