Fix bug that unable to remove fake event listener (#256)

* Fix bug that unable to remove fake event listener

* Update dist
This commit is contained in:
Alexander
2016-06-09 19:54:07 +05:00
committed by Zeno Rocha
parent a4ab305297
commit 869c4e3219
3 changed files with 12 additions and 14 deletions

View File

@ -49,7 +49,8 @@ class ClipboardAction {
this.removeFake();
this.fakeHandler = document.body.addEventListener('click', () => this.removeFake()) || true;
this.fakeHandlerCallback = () => this.removeFake();
this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
this.fakeElem = document.createElement('textarea');
// Prevent zooming on iOS
@ -78,8 +79,9 @@ class ClipboardAction {
*/
removeFake() {
if (this.fakeHandler) {
document.body.removeEventListener('click');
document.body.removeEventListener('click', this.fakeHandlerCallback);
this.fakeHandler = null;
this.fakeHandlerCallback = null;
}
if (this.fakeElem) {