Skip to content

Commit 4456b4e

Browse files
author
Graham Butler
committed
fix body click listener bug and version bump @1.0.3
1 parent 842d1ea commit 4456b4e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@author.io/element-select",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "author-select custom element (web component).",
55
"main": "dist/author-select.min.js",
66
"scripts": {

src/element.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ class AuthorSelectElement extends AuthorBaseElement(HTMLElement) {
9292

9393
this.UTIL.definePrivateMethods({
9494
addOpenListeners: () => {
95-
document.body.addEventListener('mousedown', this.PRIVATE.bodyMousedownHandler)
96-
document.body.addEventListener('touchcancel', this.PRIVATE.bodyMousedownHandler)
97-
document.body.addEventListener('touchend', this.PRIVATE.bodyMousedownHandler)
95+
document.addEventListener('mousedown', this.PRIVATE.bodyMousedownHandler)
96+
document.addEventListener('touchcancel', this.PRIVATE.bodyMousedownHandler)
97+
document.addEventListener('touchend', this.PRIVATE.bodyMousedownHandler)
9898
},
9999

100100
blurHandler: evt => this.off('keydown', this.PRIVATE.keydownHandler),
@@ -195,9 +195,9 @@ class AuthorSelectElement extends AuthorBaseElement(HTMLElement) {
195195
},
196196

197197
removeOpenListeners: () => {
198-
document.body.removeEventListener('mousedown', this.PRIVATE.bodyMousedownHandler)
199-
document.body.removeEventListener('touchcancel', this.PRIVATE.bodyMousedownHandler)
200-
document.body.removeEventListener('touchend', this.PRIVATE.bodyMousedownHandler)
198+
document.removeEventListener('mousedown', this.PRIVATE.bodyMousedownHandler)
199+
document.removeEventListener('touchcancel', this.PRIVATE.bodyMousedownHandler)
200+
document.removeEventListener('touchend', this.PRIVATE.bodyMousedownHandler)
201201
},
202202

203203
stateChangeHandler: evt => {

0 commit comments

Comments
 (0)