Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.

Set option for all fields in struct #402

Open
DanKurf opened this issue Nov 11, 2017 · 0 comments
Open

Set option for all fields in struct #402

DanKurf opened this issue Nov 11, 2017 · 0 comments

Comments

@DanKurf
Copy link

DanKurf commented Nov 11, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant