diff --git a/frontend/src/components/steps/habitat/HabitatSelector.js b/frontend/src/components/steps/habitat/HabitatSelector.js index 47ec52b..eeae7c9 100644 --- a/frontend/src/components/steps/habitat/HabitatSelector.js +++ b/frontend/src/components/steps/habitat/HabitatSelector.js @@ -43,11 +43,12 @@ export default function HabitatSelector(props) { props.setNextDisabled(false); } }); - + const setHabitatImage = (imageId) => { // Sets the selected image radio, updates filter state for image and enable the next button setImageValue(imageId); props.updateFilterState({ "habitatImage": imageId }); + props.updateFilterState({ "zone": null }); props.setNextDisabled(false); } @@ -55,6 +56,8 @@ export default function HabitatSelector(props) { // Retrieve and set the value of the radio button const habitatSelection = event.target.value; setValue(habitatSelection); + setHabitatImage(null) + // Set the image default selection if there is only one image variation available const habitatObject = habitatsMap[habitatSelection]