Toggle: prevent clicking label getting it stuck

environments/review-groups-tog-ycn9lp/deployments/3017
Alex Gleason 2023-03-31 12:04:13 -05:00
rodzic 406e6f3f40
commit 1c71cf3da4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -9,8 +9,7 @@ interface IToggle extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'id'
const Toggle: React.FC<IToggle> = ({ id, size = 'md', name, checked, onChange, required, disabled }) => {
const input = useRef<HTMLInputElement>(null);
const handleClick: React.MouseEventHandler<HTMLButtonElement> = (e) => {
e.preventDefault();
const handleClick: React.MouseEventHandler<HTMLButtonElement> = () => {
input.current?.focus();
input.current?.click();
};