Meteor-Community-Packages / meteor-autoform-bs-datepicker

Custom "bootstrap-datepicker" input type for AutoForm
MIT License
25 stars 32 forks source link

All dates are reseted when document is changed #46

Closed batwishpers closed 7 years ago

batwishpers commented 8 years ago

When the document is updated, reactivity reset all input with date pickers to value in document. On other fields, the input is only changed when the property have changed.

If I have a schema like :

new SimpleSchema({
    one: {
        type: Date,
        autoform: { afFieldInput: { type: "bootstrap-datepicker" } }
    },
    two: {
        type: String,
    }
});

If an update is made on the document to change the value of two, one is also reseted and the value selected by the user is lost. I expected to react like the normal input helper, the value is updated only if it had been modified. (In my case, an update on one does not reset two)

I suspect the problem is caused by the autorun but i did not find how to access the previous value to check if changed.

aldeed commented 7 years ago

Should be fixed in latest release