Skip to content

Commit

Permalink
[#933] Added automatic search submit when clicking on search filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart van der Schoor committed Dec 21, 2022
1 parent efcacf2 commit e400352
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/open_inwoner/js/components/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ const radioButtons = document.querySelectorAll(
)
})
})

var timerId = 0

const searchForm = document.getElementById('search-form')

const filterButtons = document.querySelectorAll('.filter .checkbox__input')
;[...filterButtons].forEach((checkbox) => {
checkbox.addEventListener('change', (event) => {
clearInterval(timerId)
timerId = setInterval(() => {
searchForm.submit()
}, 250)
})
})

0 comments on commit e400352

Please sign in to comment.