Skip to content

Commit 28e0212

Browse files
authored
feat(calendar): remove data values on destroy
data saved to the jquery calendar object was not removed on destroy. This leads to situations when a re-instantiation of the same calendar gets confused about different setting than the previous (data()-stored) values.
1 parent 25a76d7 commit 28e0212

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/definitions/modules/calendar.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,17 @@
102102

103103
destroy: function () {
104104
module.verbose('Destroying previous calendar for', element);
105-
$module.removeData(moduleNamespace);
105+
$module.removeData([
106+
metadata.date,
107+
metadata.focusDate,
108+
metadata.startDate,
109+
metadata.endDate,
110+
metadata.minDate,
111+
metadata.maxDate,
112+
metadata.mode,
113+
metadata.monthOffset,
114+
moduleNamespace,
115+
]);
106116
module.unbind.events();
107117
module.disconnect.classObserver();
108118
},

0 commit comments

Comments
 (0)