Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16766 closed defect (fixed)

SpinWheelSlot::set("value") can fail when browser zoom is != 100%

Reported by: Eric Durocher Owned by: Eric Durocher
Priority: undecided Milestone: 1.9
Component: DojoX Mobile Version: 1.8.3
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

To reproduce the problem, save the attached test case to dojox/mobile/tests, launch in Chrome, zoom to 110% (one mouse wheel tick from 100%), reload: the picker should display Jan-1-2020, but it displays the current date instead.

The SpinWheelSlot::spin method assumes integer values for the current scroll position of the slot and tests for multiples of the item height, but when the browser zoom is set to e.g. 110%, the gePos() method can return decimal values, causing the slot to return prematurely at line 333.

Attachments (4)

test_SpinWheelDatPicker-zoom.html (1.1 KB) - added by Eric Durocher 7 years ago.
Test case for SpinWheelSlot::spin bug with browser zoom != 100%
16766.patch (583 bytes) - added by Eric Durocher 7 years ago.
Round scroll position before testing for multiple of item height, fixes set("value") sometimes failing with browser zoom != 100% - Eric Durocher (IBM, CCLA)
16766-new.patch (7.7 KB) - added by Adrian Vasiliu 7 years ago.
Improved behavior in presence of browser zoom - Adrian Vasiliu (IBM, CCLA)
patch16766-fix-in-test.patch (2.1 KB) - added by Adrian Vasiliu 7 years ago.
Fixes in test to ensure it works on any OS lang and also in IE8 - thanks edchat (IBM, CCLA)

Download all attachments as: .zip

Change History (12)

Changed 7 years ago by Eric Durocher

Test case for SpinWheelSlot::spin bug with browser zoom != 100%

Changed 7 years ago by Eric Durocher

Attachment: 16766.patch added

Round scroll position before testing for multiple of item height, fixes set("value") sometimes failing with browser zoom != 100% - Eric Durocher (IBM, CCLA)

comment:1 Changed 7 years ago by Eric Durocher

Cc: cjolif added

comment:2 Changed 7 years ago by Eric Durocher

Milestone: tbd1.9

comment:3 Changed 7 years ago by Eric Durocher

Status: newassigned

comment:4 Changed 7 years ago by cjolif

Resolution: fixed
Status: assignedclosed

In [30722]:

fixes #16766. Round scroll position before testing for multiple of item height, fixes set(value) sometimes failing with browser zoom != 100%. Thanks Eric Durocher (IBM, CCLA).

comment:5 Changed 7 years ago by Eric Durocher

Resolution: fixed
Status: closedreopened

Seems there are still cases when this fails -> reopening

Changed 7 years ago by Adrian Vasiliu

Attachment: 16766-new.patch added

Improved behavior in presence of browser zoom - Adrian Vasiliu (IBM, CCLA)

comment:6 Changed 7 years ago by cjolif

I'll be committing this but I don't think deleting the properties make sense in this case. These are properties that will be used regularly during the life of the component we should just set them back & forth to true/false (this allows JavaScript? VMs to optimize the class also to not add/delete fields regularly). I'll do the change myself.

comment:7 Changed 7 years ago by cjolif

Resolution: fixed
Status: reopenedclosed

In [30782]:

fixes #16766. Improved the fix in presence of browser zoom. Thanks Adrian Vasiliu (IBM, CCLA) (with some changes). !strict.

Changed 7 years ago by Adrian Vasiliu

Fixes in test to ensure it works on any OS lang and also in IE8 - thanks edchat (IBM, CCLA)

comment:8 Changed 7 years ago by Ed Chatelain

In [30961]:

refs #16766 Fixes in test to ensure it works on any OS lang and also in IE8 !strict

Note: See TracTickets for help on using tickets.