Skip to content

Commit

Permalink
fix: do not apply handlers for already handled checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdeSV committed Jul 6, 2024
1 parent 70d0767 commit fbb3ed3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions checkswipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ function checkswipe(parent, checkbox) {
return
}

if (checkbox.__checkswipe) {
return
}

checkbox.__checkswipe = true

checkbox.addEventListener('mousedown', () => {
const state = !checkbox.checked
checkbox.checked = state
Expand Down

0 comments on commit fbb3ed3

Please sign in to comment.