From 28f743daef7ee7cc66e14099bc60c05391a51f1c Mon Sep 17 00:00:00 2001 From: Gabriel De Los Rios Date: Fri, 6 Dec 2024 00:50:05 -0300 Subject: [PATCH] fix: prevents null node to be added --- app/static/js/pets-filter.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/static/js/pets-filter.js b/app/static/js/pets-filter.js index aab0706..a51f000 100644 --- a/app/static/js/pets-filter.js +++ b/app/static/js/pets-filter.js @@ -9,7 +9,6 @@ function updateToYearsFilter(event) { const startYear = event.target.value; - toYearsFilter.replaceChildren(null); if(startYear == 7) { toYearsFilter.removeAttribute('name'); toYearsFilter.classList.add('d-none'); @@ -24,7 +23,7 @@ option.value = "7"; option.innerText = "7+"; option.selected = true; - toYearsFilter.appendChild(option); + toYearsFilter.replaceChildren(option); for(let i = 6; i > startYear; i--) { const option = document.createElement('option');