TP-0 | Hotfix geolocation feedback

This commit is contained in:
Aman Chaturvedi
2023-10-10 14:27:20 +05:30
parent 04d4089404
commit 8950647900
2 changed files with 9 additions and 2 deletions

View File

@@ -64,6 +64,8 @@ const AddressSelection: React.FC<IAddressSelection> = (props) => {
const addresses = (isGeolocation ? currentCase?.geolocations : currentCase?.addresses) || [];
const controllerName = `widgetContext.${widgetId}.sectionContext.${sectionId}.questionContext.${questionId}`;
return (
<View>
<ErrorMessage
@@ -74,9 +76,10 @@ const AddressSelection: React.FC<IAddressSelection> = (props) => {
}
/>
<Controller
key={controllerName}
control={control}
rules={{ validate: (data) => validateInput(data, question.metadata.validators) }}
render={({ field: { onChange, value } }) => (
render={({ field: { onChange, value, name } }) => (
<RadioGroup
value={value?.answer}
onValueChange={(change) => handleChange(change, onChange)}
@@ -88,6 +91,9 @@ const AddressSelection: React.FC<IAddressSelection> = (props) => {
: getAddressString(address as Address);
return (
<RNRadioButton
key={
isGeolocation ? (address as IGeolocation).id : (address as Address).referenceId
}
id={
isGeolocation ? (address as IGeolocation).id : (address as Address).referenceId
}
@@ -103,7 +109,7 @@ const AddressSelection: React.FC<IAddressSelection> = (props) => {
})}
</RadioGroup>
)}
name={`widgetContext.${widgetId}.sectionContext.${sectionId}.questionContext.${questionId}`}
name={controllerName}
/>
</View>
);

View File

@@ -148,6 +148,7 @@ const RadioButton: React.FC<IRadioButton> = (props) => {
})
: question.options.map((option: keyof typeof options) => (
<RadioChip
key={option}
id={option as string}
value={options[option]?.text}
containerStyle={GenericStyles.whiteBackground}