Skip to content

Commit

Permalink
Merge pull request #4044 from 10up/fix/js-error-for-date-block
Browse files Browse the repository at this point in the history
Fix date block error when date is not selected
  • Loading branch information
felipeelia authored Dec 11, 2024
2 parents bcb55e3 + a68165b commit 6bc7822
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/js/blocks/facets/date/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const initFacet = () => {
form.addEventListener('submit', function (event) {
event.preventDefault();

const { value } = this.querySelector(`[name="${filterName}"]:checked`);
const { value } = this.querySelector(`[name="${filterName}"]:checked`) || '';
if (!value) {
return;
}

const { value: startDateValue } =
this.querySelector('.ep-date-range-picker')?.querySelector(
`[name="${filterName}_from"]`,
Expand Down

0 comments on commit 6bc7822

Please sign in to comment.