Skip to content

Commit

Permalink
fix: Support textarea fields (legacy support for iD presets)
Browse files Browse the repository at this point in the history
In Mapeo we now use type='text' and multiline=true for text areas (like ODK field defs)
  • Loading branch information
gmaclennan committed Oct 7, 2019
1 parent 85005b3 commit 08e86c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants/field_types.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
export const TEXT: 'text' = 'text'
export const TEXTAREA: 'textarea' = 'textarea'
export const NUMBER: 'number' = 'number'
export const SELECT_ONE: 'select_one' = 'select_one'
export const SELECT_MULTIPLE: 'select_multiple' = 'select_multiple'
Expand Down
1 change: 1 addition & 0 deletions src/internal/FormattedValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const FormattedValue = ({ value, field }: Props) => {
const valueAsNumber = coerceValue(value, valueTypes.NUMBER)
return valueAsNumber + ''
case fieldTypes.TEXT:
case fieldTypes.TEXTAREA:
case fieldTypes.SELECT_ONE:
if (typeof value === 'boolean') return value ? 'yes' : 'no'
const valueAsString = coerceValue(value, valueTypes.STRING)
Expand Down

0 comments on commit 08e86c4

Please sign in to comment.