Opened 8 years ago

Closed 8 years ago

#13614 closed defect (fixed)

dijit._Spinner _mouseWheeled may mishandle scroll amount for webkit browsers

Reported by: Cedric Hobbs Owned by: Douglas Hays
Priority: high Milestone: 1.7
Component: Dijit - Form Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

I noticed this by using the two-finger trackpad gesture in Safari and Chrome on a Mac for a NumberSpinner? widget whose only constraints were min and max. I would expect the deltas of the displayed value to be limiited by the default value (1) of the smallDelta attribute, but instead it changes in fractional values. This doesn't happen in Firefox or IE.

It looks like the _mouseWheeled() method divides the evt.wheelDelta value by 120, presumably for IE, whose deltas are in increments of 120. However, webkit browsers have an evt.wheelDelta value that's NOT in multiples of 120, so that wheel scrolling can result in fractional values for Safari and Chrome.

Explicitly using either "places:0" or "fractional:false" in the widget's constraints makes the behavior consistent across browsers, although the scroll is a little less sensitive.

Change History (2)

comment:1 Changed 8 years ago by Douglas Hays

Milestone: tbd1.7
Status: newassigned

The wheel increments are still multiples of 120 on mac, but what is different are the increments of touch gestures that get converted to fake wheel events. For these events, I'll just convert them to single mouse wheel clicks.

comment:2 Changed 8 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

In [26129]:

Fixes #13614. If the wheelDelta is not a multiple of 120, then assume its a touch gesture and convert it to a single wheel movement click.

Note: See TracTickets for help on using tickets.