Skip to content

Commit

Permalink
fix(initall): ensure datepickers respect scope when initialised
Browse files Browse the repository at this point in the history
Datepickers were always initialised within the document scope, and would ignore any scope passed to
the intiAll function.
  • Loading branch information
chrispymm committed Jan 9, 2025
1 parent fdfa97b commit 7d864fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/moj/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ MOJFrontend.initAll = function (options) {
});
});

const $datepickers = document.querySelectorAll('[data-module="moj-date-picker"]')
const $datepickers = scope.querySelectorAll('[data-module="moj-date-picker"]')
MOJFrontend.nodeListForEach($datepickers, function ($datepicker) {
new MOJFrontend.DatePicker($datepicker, {}).init();
})
Expand Down

0 comments on commit 7d864fa

Please sign in to comment.