Skip to content

Commit

Permalink
fix(calendar): don't trigger dropdown refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Dec 14, 2024
1 parent 95084c9 commit 74f833f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/public/app/widgets/buttons/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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}`);

Expand Down

0 comments on commit 74f833f

Please sign in to comment.