From 54a826bc2da10b6577f3fc9e4f6a5b4e004b7c84 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 2 Jul 2025 16:56:05 -0600 Subject: [PATCH] disable radio and dropdown for the component if it is primed to add --- src/device/autoDetect/ScannedI2C.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/device/autoDetect/ScannedI2C.tsx b/src/device/autoDetect/ScannedI2C.tsx index d937c7d..915a29b 100644 --- a/src/device/autoDetect/ScannedI2C.tsx +++ b/src/device/autoDetect/ScannedI2C.tsx @@ -21,7 +21,7 @@ export default function ScannedI2C(props: Props){ const [subtypeOptions, setSubtypeOptions] = useState>([]) const [selectedPrimaryType, setSelectedPrimaryType] = useState(quack.ComponentType.COMPONENT_TYPE_INVALID) const [selectedPrimarySubtype, setSelectedPrimarySubtype] = useState(0) - const [added,setAdded] = useState(false) + const [added, setAdded] = useState(false) const [addressInUse, setAddressInUse] = useState(false) useEffect(()=>{ @@ -80,7 +80,7 @@ export default function ScannedI2C(props: Props){ const componentSelected = (event: React.ChangeEvent, checked: boolean) => { let toAdd: Component[] = [] - setAdded(true) + setAdded(checked) //build a component with given information and defaults for the rest let primaryComponent = Component.create() primaryComponent.settings.type = selectedPrimaryType @@ -120,6 +120,7 @@ export default function ScannedI2C(props: Props){ {types.map((type, i) => { return ( } @@ -132,6 +133,7 @@ export default function ScannedI2C(props: Props){ {subtypeOptions.length > 0 && { @@ -152,7 +154,7 @@ export default function ScannedI2C(props: Props){ } />