@samitouri / QOS-React / commits / bd9dbd5d60

Remove MouseWheel and MouseDOMScroll event patching

The `wheel` event has not always been supported in every browser. React would fall back to `mousewheel` and `DOMMouseScroll` when the `wheel` event was not available. All supported browsers provide the `wheel` event. This code is no longer necessary.

cristidrg committed Nov 20, 2017 at 12:40 UTC bd9dbd5d6092ea4839d9b7766e90b558ed9f8941
1 file changed +1 -11
packages/react-dom/src/events/ReactBrowserEventEmitter.js
+1 -11
@@ -123,17 +123,7 @@ export function listenTo(registrationName, contentDocumentHandle) {
123 for (var i = 0; i < dependencies.length; i++) {
124 var dependency = dependencies[i];
125 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
126 - if (dependency === 'topWheel') {
127 - if (isEventSupported('wheel')) {
128 - trapBubbledEvent('topWheel', 'wheel', mountAt);
129 - } else if (isEventSupported('mousewheel')) {
130 - trapBubbledEvent('topWheel', 'mousewheel', mountAt);
131 - } else {
132 - // Firefox needs to capture a different mouse scroll event.
133 - // @see http://www.quirksmode.org/dom/events/tests/scroll.html
134 - trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);
135 - }
136 - } else if (dependency === 'topScroll') {
126 + if (dependency === 'topScroll') {
127 trapCapturedEvent('topScroll', 'scroll', mountAt);
128 } else if (dependency === 'topFocus' || dependency === 'topBlur') {
129 trapCapturedEvent('topFocus', 'focus', mountAt);