From 2deb3faec0a3721b3a1d349f4b2c3adebdfdf709 Mon Sep 17 00:00:00 2001 From: Dana Lambert Date: Wed, 20 Oct 2021 13:14:12 +1300 Subject: [PATCH] Load previous soil variant selection during step navigation --- .../src/components/steps/soilvariantstep/SoilSelector.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/steps/soilvariantstep/SoilSelector.js b/frontend/src/components/steps/soilvariantstep/SoilSelector.js index 12fc9b1..bd2ed80 100644 --- a/frontend/src/components/steps/soilvariantstep/SoilSelector.js +++ b/frontend/src/components/steps/soilvariantstep/SoilSelector.js @@ -20,9 +20,15 @@ const MESIC_SOIL_DESCRIPTION = (

); export default function SoilSelector(props) { - const [value, setValue] = React.useState(''); + const [value, setValue] = React.useState(props.filters.soilVariant); const [helperText, setHelperText] = React.useState('Please select your soil variant from the options above.'); + React.useEffect(() => { + if (props.filters.soilVariant) { + props.setNextDisabled(false); + } + }); + const handleRadioChange = (event) => { const soilVariantSelection = event.target.value; setValue(soilVariantSelection);