Remove addEventListener check in isEventSupported (#13435)

* Remove addEventListener check in isEventSupported

All browsers we support also support addEventListener, so this check is
unncessary

* Remove capture argument from isEventSupported
This commit is contained in:
Brandon Dail
2018-08-20 12:26:06 +01:00
committed by Dan Abramov
parent a869f992a8
commit d1c42d2f1e
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ export function listenTo(
break;
case TOP_CANCEL:
case TOP_CLOSE:
if (isEventSupported(getRawEventName(dependency), true)) {
if (isEventSupported(getRawEventName(dependency))) {
trapCapturedEvent(dependency, mountAt);
}
break;
+2 -3
View File
@@ -16,13 +16,12 @@ import {canUseDOM} from 'shared/ExecutionEnvironment';
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/
function isEventSupported(eventNameSuffix, capture) {
if (!canUseDOM || (capture && !('addEventListener' in document))) {
function isEventSupported(eventNameSuffix) {
if (!canUseDOM) {
return false;
}