From 74f833f7b295da9545c9a2e8cb23dbf4036e14fb Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 14 Dec 2024 03:58:11 +0200 Subject: [PATCH] fix(calendar): don't trigger dropdown refresh --- src/public/app/widgets/buttons/calendar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/public/app/widgets/buttons/calendar.js b/src/public/app/widgets/buttons/calendar.js index e99ac4aaa..d848bbefe 100644 --- a/src/public/app/widgets/buttons/calendar.js +++ b/src/public/app/widgets/buttons/calendar.js @@ -86,6 +86,10 @@ export default class CalendarWidget extends RightDropdownButtonWidget { // Month navigation this.$monthSelect = this.$dropdownContent.find('[data-calendar-input="month"]'); + this.$monthSelect.on("show.bs.dropdown", (e) => { + // Don't trigger dropdownShown() at widget level when the month selection dropdown is shown, since it would cause a redundant refresh. + e.stopPropagation(); + }); this.monthDropdown = bootstrap.Dropdown.getOrCreateInstance(this.$monthSelect); this.$dropdownContent.find('[data-calendar-input="month-list"] button').on("click", (e) => { this.date.setMonth(e.target.dataset.value); @@ -218,6 +222,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget { } async createMonth() { + console.log(new Error()); const month = utils.formatDateISO(this.date).substr(0, 7); const dateNotesForMonth = await server.get(`special-notes/notes-for-month/${month}`);