Meteor-Community-Packages / meteor-simple-schema

Meteor integration package for simpl-schema
https://github.com/Meteor-Community-Packages/meteor-simple-schema
MIT License
920 stars 162 forks source link

the optional: true afFieldInput have the required attribute with it #732

Closed salmanhasni closed 6 years ago

salmanhasni commented 6 years ago

example

export const RecruitablePlayerSchema = new SimpleSchema({
  ratings: {
    type: [Object],
    blackbox: true,
    optional: true
  },

 {{> afFieldInput type="text" name="ratings.0.value" id="rating-freeform" }}

then it is rendered as <input type="text" name="ratings.0.value" id="rating-freeform" required="" data-schema-key="ratings.0.value" class="form-control">

salmanhasni commented 6 years ago

solved my query with required=false