...
Solutions?
1) Not sure if adding an and condition for !data.draft would solve it as it probably is always true when editing a draft. - Tested this and it always comes in as draft = true on submit of draft
2) Failing a submission should set the data.data.submit flag back to false?
The following seems to prevent the behavior from occuring as a temporary solution until Jason rewrites event subscription:
var isValid = form.checkValidity(form.submission.data);
if (isValid) {
data.submit = true;
let that = this;
that.parent.root = form;
form.emit('submitButton', { state: 'submitted', component: that, instance: that, data:form.submission.data }); } else {
form.submit(); data.submit = false;
}
...
nfeli - Discusses the issue in discord on chefs-tldr
...