From 28e02122a23aaea5abf6f045fcdbf32556075ad5 Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Tue, 23 Apr 2024 20:57:48 +0200 Subject: [PATCH] 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. --- src/definitions/modules/calendar.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/calendar.js b/src/definitions/modules/calendar.js index 3c3c25a207..3e82030b27 100644 --- a/src/definitions/modules/calendar.js +++ b/src/definitions/modules/calendar.js @@ -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(); },