From ec45b861b66ef31bd90f937627266d943c621ec4 Mon Sep 17 00:00:00 2001 From: riophae Date: Mon, 16 Oct 2017 05:29:18 +0800 Subject: [PATCH] refactor componentWillUnmount() --- src/Select.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Select.js b/src/Select.js index 1c593413e1..99eabe98ae 100644 --- a/src/Select.js +++ b/src/Select.js @@ -143,11 +143,7 @@ class Select extends React.Component { } componentWillUnmount () { - if (!document.removeEventListener && document.detachEvent) { - document.detachEvent('ontouchstart', this.handleTouchOutside); - } else { - document.removeEventListener('touchstart', this.handleTouchOutside); - } + this.toggleTouchOutsideEvent(false); } toggleTouchOutsideEvent (enabled) {