Skip to content

Commit 23223ec

Browse files
fix unsaved conditions
1 parent 9082ced commit 23223ec

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/mm-form/mm-form.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,12 @@
210210
this._validateField(name, value);
211211

212212
// show messaging in the footer
213-
if (!this.unsaved && this.showUnsavedMessage) {
213+
if (this.unsaved && this.showUnsavedMessage) {
214214
this._footerMessage = this.footerMessages.warning;
215215
this._footerType = 'warning';
216216
this._showFooterMessage = true;
217+
} else {
218+
this._showFooterMessage = false;
217219
}
218220
}
219221
},
@@ -226,11 +228,11 @@
226228
_diffData: function() {
227229
var diff = [];
228230
for (var key in this.formData) {
229-
if (key !== this.data[key].value) {
231+
if (this.formData[key] !== this.data[key].value) {
230232
diff.push(key);
231233
}
232234
}
233-
return !diff.length > 0;
235+
return diff.length > 0;
234236
},
235237

236238
// form validation

0 commit comments

Comments
 (0)