import { FocusEvent, forwardRef, RefObject, useCallback } from 'react'; import { stopPropagation } from '../../utils'; import styles from './styles.module.scss'; type HiddenTabButtonProps = { listRef: RefObject; tabIndex?: number; }; export const HiddenTabButton = forwardRef(({ listRef, tabIndex }, ref) => { const handleFocus = useCallback( (e: FocusEvent) => { if (e.relatedTarget !== listRef.current) { listRef.current?.focus(); } e.preventDefault(); e.stopPropagation(); }, [listRef], ); return (