From 4be99f06f6e56ed18fe7c969544139170aa8f1fc Mon Sep 17 00:00:00 2001 From: Chris Wilton-Magras Date: Wed, 2 Oct 2024 10:07:57 +0100 Subject: [PATCH] fix: Checkbox must be associated with label using id --- .../src/components/summary-view/MapViewHeader.tsx | 11 +++++++++-- .../src/components/summary-view/SummaryViewHeader.tsx | 10 ++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/air-quality-ui/src/components/summary-view/MapViewHeader.tsx b/air-quality-ui/src/components/summary-view/MapViewHeader.tsx index f5c7dddd..aaf7a0ca 100644 --- a/air-quality-ui/src/components/summary-view/MapViewHeader.tsx +++ b/air-quality-ui/src/components/summary-view/MapViewHeader.tsx @@ -1,4 +1,5 @@ import Switch from '@mui/material/Switch' +import { ChangeEvent, useId } from 'react' import classes from './MapViewHeader.module.css' @@ -11,15 +12,21 @@ export const MapViewHeader = ({ showMap, setShowMap, }: MapViewHeaderProps): JSX.Element => { + const switchId = useId() + return (
-