Skip to content

Commit

Permalink
feat(calendar): remove data values on destroy
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lubber-de authored Apr 23, 2024
1 parent 25a76d7 commit 28e0212
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,17 @@

destroy: function () {
module.verbose('Destroying previous calendar for', element);
$module.removeData(moduleNamespace);
$module.removeData([
metadata.date,
metadata.focusDate,
metadata.startDate,
metadata.endDate,
metadata.minDate,
metadata.maxDate,
metadata.mode,
metadata.monthOffset,
moduleNamespace,
]);
module.unbind.events();
module.disconnect.classObserver();
},
Expand Down

0 comments on commit 28e0212

Please sign in to comment.