Meteor-Community-Packages / meteor-autoform

AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
MIT License
1.44k stars 328 forks source link

Groups with nested schema displayed twice #1681

Closed TechplexEngineer closed 3 years ago

TechplexEngineer commented 5 years ago

Fields with no autoform: { group: "<>" } that are a child of another field that does have a "group" attr are displayed twice.

example schema:

const nestedSchema = new SimpleSchema({
    field: {
        type: String
    }
});
const schema = new SimpleSchema({
    data: {
        type: nestedSchema,
        autoform: { group: "Group1" }
    }
});

Form will display:

Input for "field"
-- Group1 --
Data Panel
    input for "field"

If I'm not too far off the mark I think this function just needs to get a bit smarter: https://github.com/aldeed/meteor-autoform/blob/devel/components/quickForm/quickForm.js#L132-L137

@SachaG was this intentional for a reason I can't think of?

SachaG commented 5 years ago

Sorry I don't really use Autoform anymore, can't say I remember much about that code…

jankapunkt commented 3 years ago

Could not reproduce. This issue may have been resolved with AutoForm 7.0.0, please migrate to the latest version and reopen in case the issue persist