Skip to content

Commit

Permalink
fix(ErrorFormTooltip): fix event types
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Jun 26, 2023
1 parent 9c0ecdd commit 8e85a57
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -7,7 +7,7 @@ const useErrorTooltip = <T = HTMLInputElement, K = HTMLLabelElement>({
onFocus,
hasTooltip = true,
}: {
onFocus?: Event<React.SyntheticEvent<T>>;
onFocus?: Event<React.FocusEvent<T>>;
hasTooltip?: boolean;
}): {
tooltipShown: boolean;
Expand All @@ -16,15 +16,15 @@ const useErrorTooltip = <T = HTMLInputElement, K = HTMLLabelElement>({
setTooltipShownHover: React.Dispatch<React.SetStateAction<boolean>>;
labelRef: React.MutableRefObject<K | null>;
iconRef: React.MutableRefObject<HTMLDivElement | null>;
handleFocus: Event<React.SyntheticEvent<T>>;
handleFocus: Event<React.FocusEvent<T>>;
} => {
const [tooltipShown, setTooltipShown] = useState(false);
const [tooltipShownHover, setTooltipShownHover] = useState(false);
const labelRef = useRef<K | null>(null);
const iconRef = useRef<HTMLDivElement | null>(null);

const handleFocus = useCallback(
(ev: React.SyntheticEvent<T>) => {
(ev: React.FocusEvent<T>) => {
if (onFocus) onFocus(ev);
if (hasTooltip) setTooltipShown(true);
},
Expand Down

0 comments on commit 8e85a57

Please sign in to comment.