TP-0 | Hotfix geolocation feedback
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user