Missing onwheel attribute for the wheel event although it's supported via addEventListener - by m_gol

Status : 


ID 782835 Comments
Status Active Workarounds
Type Bug Repros 3
Opened 4/2/2013 9:03:08 AM
Access Restriction Public
Primary Feedback Item 768199


Both IE9 & IE10 support the standard wheel event via addEventListener. Unfortunately, neither of them supports the onwheel attribute on DOM elements which makes it **extremely** hard to detect support. A simple check like:

    var nativeEvent = 'onwheel' in document.createElement('div') ? 'wheel' : 'mousewheel';

works fine in Firefox (which supports the event) and in WebKit (which doesn't). IE gets redirected to 'mousewheel', erroneously. This is especially important because IE implementation of mousewheel doesn't support wheelDeltaX & wheelDeltaY, only wheelDelta which makes it impossible to detect horizontal & vertical scrolling separately which is possible via wheel event (in IE & Fx) and via mousewheel event in WebKit.
Sign in to post a comment.
Posted by Microsoft on 8/22/2013 at 2:41 PM
Hello m_gol,
We are tracking a duplicate issue to the one you reported please see the duplicate bug #768119 or use this link. <http://connect.microsoft.com/IE/feedback/details/768199/onwheel-feature-detection>
At this time we are closing this feedback item as a duplicate of 768199.
Best regards,
The Internet Explorer Team
Posted by m_gol on 8/20/2013 at 6:06 AM
.hasFeature now always returns true not only in Firefox:
but in WebKit as well (at least outside of SVG):

Chrome will likely follow, which makes IE the only browser to not always return true. How is sniffing for IE and then using hasFeature better than just sniffing itself?

Please, revisit your reasons and add support for the onwheel attribute.
Posted by m_gol on 8/19/2013 at 2:01 AM
Considering that IE11 doesn't have MSIE in its user agent and reports its appName as Netscape, expect the wheel event feature detection to be broken in many places. All other browsers do have the `onwheel` attribute which makes it possible to detect support for the event.

.hasFeature() is effectively dead; it's not an appropriate method for feature detects. Please, provide a method for us to test for the existence of this event in IE11 without forcing us to use browser-specific hacks.
Posted by GreLI on 8/14/2013 at 12:39 PM
Moreover, now it will always return true in Webkit¹ while it does NOT support Wheel Events 3.0.

¹ http://trac.webkit.org/changeset/153901
Posted by Dave_Methvin on 7/4/2013 at 8:05 AM
We can't use .hasFeature() cross-browser now because it's been effectively deprecated and always returns true in Firefox.



We're not wedded to 'onwheel' in document.createElement('div') but would like *some* non-browser-sniffing way to know if the wheel event is supported. Otherwise we'll end up with an obscure IE-specific indirect feature sniff.
Posted by Microsoft on 5/24/2013 at 1:23 PM
Thank you for your feedback.

This behavior is non-standard and only supported in Firefox. Not all events have on* equivalents in the OM, so feature detection via this approach is not consistent in the web platform.

However, this can be feature-detected in IE via the hasFeature API (after verifying that the current browser doesn't always return true for arbitrary strings starting with "Events").
    document.implementation.hasFeature("Events.wheel", "3.0");

Best regards,

The Internet Explorer Team
Posted by Microsoft on 4/2/2013 at 11:03 AM
Thank you for your feedback. Please disregard the last message. We will be investigating this issue further.

Best regards,

The Internet Explorer Team
Posted by Microsoft on 4/2/2013 at 10:59 AM
Thank you for your feedback.

We are currently unable to reproduce this issue as described.

Mousewheel event detected on ie10 win7,8.

We value your feedback. If you have additional information that can help us recreate this issue — such as a specific url, more detailed steps, test results from different machines, or additional conditions — please reactivate the bug or submit a new bug with more details on how to reproduce the issue. You can also read the guidelines at https://connect.microsoft.com/IE/content/content.aspx?ContentID=16254 regarding filing a good bug report.

Best regards,

The Internet Explorer Team