From c3fefc1fc0662a5ac11eafb251d59fc9e29349e2 Mon Sep 17 00:00:00 2001 From: grabus Date: Thu, 26 May 2016 21:35:18 +0300 Subject: [PATCH] Fix memory leak because of fakeHandlers (#243) addEventListener always returns undefined by spec https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget-addEventListener --- src/clipboard-action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clipboard-action.js b/src/clipboard-action.js index 97452f8..e33a677 100644 --- a/src/clipboard-action.js +++ b/src/clipboard-action.js @@ -49,7 +49,7 @@ class ClipboardAction { this.removeFake(); - this.fakeHandler = document.body.addEventListener('click', () => this.removeFake()); + this.fakeHandler = document.body.addEventListener('click', () => this.removeFake()) || true; this.fakeElem = document.createElement('textarea'); // Prevent zooming on iOS