mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
committed by
Dan Abramov
parent
a869f992a8
commit
d1c42d2f1e
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user