Update habitat selector to reset image/zone on habitat change
This commit is contained in:
parent
f92bb7290c
commit
01a3328ec2
1 changed files with 4 additions and 1 deletions
|
@ -43,11 +43,12 @@ export default function HabitatSelector(props) {
|
||||||
props.setNextDisabled(false);
|
props.setNextDisabled(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const setHabitatImage = (imageId) => {
|
const setHabitatImage = (imageId) => {
|
||||||
// Sets the selected image radio, updates filter state for image and enable the next button
|
// Sets the selected image radio, updates filter state for image and enable the next button
|
||||||
setImageValue(imageId);
|
setImageValue(imageId);
|
||||||
props.updateFilterState({ "habitatImage": imageId });
|
props.updateFilterState({ "habitatImage": imageId });
|
||||||
|
props.updateFilterState({ "zone": null });
|
||||||
props.setNextDisabled(false);
|
props.setNextDisabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +56,8 @@ export default function HabitatSelector(props) {
|
||||||
// Retrieve and set the value of the radio button
|
// Retrieve and set the value of the radio button
|
||||||
const habitatSelection = event.target.value;
|
const habitatSelection = event.target.value;
|
||||||
setValue(habitatSelection);
|
setValue(habitatSelection);
|
||||||
|
setHabitatImage(null)
|
||||||
|
|
||||||
|
|
||||||
// Set the image default selection if there is only one image variation available
|
// Set the image default selection if there is only one image variation available
|
||||||
const habitatObject = habitatsMap[habitatSelection]
|
const habitatObject = habitatsMap[habitatSelection]
|
||||||
|
|
Loading…
Reference in a new issue