Skip to content

Commit

Permalink
fix: ensure textQuestion handled when not present
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-mccombs committed Jun 8, 2021
1 parent 5f10894 commit e667d2a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/FormikFields/PaperInputPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ const PaperInputPicker = ({
<View key={result.value}>
{result.text === true && result.value === values[formikKey] && (
<View style={stylesDefault} key={result.textKey}>
<Text>{customForm ? result.textQuestion : I18n.t(result.textQuestion)}</Text>
{result.textQuestion !== undefined && result.textQuestion.length > 0 && (
<Text>{customForm ? result.textQuestion : I18n.t(result.textQuestion)}</Text>
)}
<TextInput
label={customForm ? result.label : I18n.t(result.label)}
onChangeText={handleChange(result.textKey)}
Expand Down Expand Up @@ -301,7 +303,9 @@ const PaperInputPicker = ({
{result.text === true && values[formikKey]
&& values[formikKey].includes(result.value) && (
<View style={stylesDefault} key={result.textKey}>
<Text>{customForm ? result.textQuestion : I18n.t(result.textQuestion)}</Text>
{result.textQuestion !== undefined && result.textQuestion.length > 0 && (
<Text>{customForm ? result.textQuestion : I18n.t(result.textQuestion)}</Text>
)}
<TextInput
label={customForm ? result.label : I18n.t(result.label)}
onChangeText={handleChange(result.textKey)}
Expand Down

0 comments on commit e667d2a

Please sign in to comment.