gcanti/tcomb-form

Set option for all fields in struct

DanKurf opened this issue · 0 comments

Version

  • "react-native": "0.44.2",
    -"tcomb-form-native": "^0.6.10"

Expected behaviour

I have a struct like this:

t.struct({
        rank1:AssessmentTypes,
        rank2:AssessmentTypes,
        rank3:AssessmentTypes,
        rank4:AssessmentTypes,
        rank5:AssessmentTypes,
        rank6:AssessmentTypes,
        rank7:AssessmentTypes,
        career: t.Number,
        personalityAndHobbies: t.Number,
        health: t.Number,
        relationship:t.Number,
        financial:t.Number,
        placeAndEnvironment:t.Number,
        spirituality:t.maybe(t.Number)
      })

I would like to be able to pass 'auto:"placeholders"' to all of these fields, i.e.

options:{
        fields: {
auto:'placeholders'
                  }
                       }

Actual behaviour

Instead, the only way I can get it to work is by passing to each individual field within the struct, i.e.

options:{
        fields: {
        rank1:{
            label: 'Rank the 7 Areas in terms of the order of importance you gave them over the past 5 years.\nRank 1:'
            auto:'placeholders'
        },
        rank2:{
          auto:'placeholders'
        }
}
}

Please advise, thanks.