Skip to content

Commit

Permalink
Use click event (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
aki77 committed Apr 16, 2022
1 parent 1199fca commit 8d970fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/textcomplete-core/src/Dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,15 @@ class DropdownItem {
span.innerHTML = this.searchResult.render()
li.appendChild(span)

li.addEventListener("mousedown", this.onClick)
li.addEventListener("touchstart", this.onClick)
li.addEventListener("click", this.onClick)

this.el = li
}

destroy(): this {
const li = this.el
li.parentNode?.removeChild(li)
li.removeEventListener("mousedown", this.onClick, false)
li.removeEventListener("touchstart", this.onClick, false)
li.removeEventListener("click", this.onClick, false)
return this
}

Expand Down

0 comments on commit 8d970fc

Please sign in to comment.