Opened 7 years ago

Closed 7 years ago

#15403 closed defect (fixed)

data not central when slide down/up dojox.mobile.DatePicker wheel

Reported by: Eric Wang Owned by: Eric Durocher
Priority: undecided Milestone: 1.9
Component: DojoX Mobile Version: 1.7.2
Keywords: Cc: todoapp, Soyhy Lim
Blocked By: Blocking:

Description (last modified by cjolif)

data not central when slide down/up dojox.mobile.DatePicker wheel. see MobileGallery showcase "picker" and the attachment picture.

Attachments (2)

datepicker.JPG (41.1 KB) - added by Eric Wang 7 years ago.
patch15403-reset.patch (1.1 KB) - added by Adrian Vasiliu 7 years ago.
Fix for reset()/spin() not working in some cases - Adrian Vasiliu, IBM, CCLA

Download all attachments as: .zip

Change History (17)

Changed 7 years ago by Eric Wang

Attachment: datepicker.JPG added

comment:1 Changed 7 years ago by cjolif

Cc: todoapp added
Description: modified (diff)

comment:2 Changed 7 years ago by Eric Durocher

Cc: Soyhy Lim added

comment:3 Changed 7 years ago by Eric Durocher

By "data not central" I guess you mean that the labels are not vertically centered on the indicator area, correct? I don't reproduce this either in the mobile gallery or in the todoapp, so I guess we are missing something here, can you give a little more details on how to reproduce? And on which device/browser, etc? Thanks.

comment:4 in reply to:  3 Changed 7 years ago by Eric Wang

Replying to edurocher:

By "data not central" I guess you mean that the labels are not vertically centered on the indicator area, correct? I don't reproduce this either in the mobile gallery or in the todoapp, so I guess we are missing something here, can you give a little more details on how to reproduce? And on which device/browser, etc? Thanks.

Yes, that means the labels are not vertically centered on the indicator area. This issue occurs on Chrome. My test environment is: Win7, Chrome 19.0.1084.52 m, also the "Reset" button in "Spin Date" & "Spin Time"(MobileGallery? Pickers) not work on Chrome. Also I test on Android and iOS and it's OK.

comment:5 Changed 7 years ago by Soyhy Lim

I have just tried with Chrome (version 19.0.1084.52 m) on Windows 7 but could neither reproduce the alignment issue nor the non working Reset button (of the Mobile Gallery, in trunk). Are you using a specific build or version?

Thanks,

Soyhy.

comment:6 Changed 7 years ago by Eric Wang

This issue is going very interesting. I start an Apache server on my local machine, and visit it by:

http://localhost/demos/mobileGallery/demo-iphone.html, the data picker not in the center area and the reset button not work.

However, if I use my physical IP address to visit it by: http://9.111.42.154/demos/mobileGallery/demo-iphone.html, all the data pickers work well.

Last edited 7 years ago by Eric Wang (previous) (diff)

comment:7 in reply to:  6 Changed 7 years ago by Soyhy Lim

Replying to EricWang:

This issue is going very interesting. I start an Apache server on my local machine, and visit it by:

http://localhost/demos/mobileGallery/demo-iphone.html, the data picker not in the center area and the reset button not work.

However, if I use my physical IP address to visit it by: http://9.111.42.154/demos/mobileGallery/demo-iphone.html, all the data pickers work well.

I still can't reproduce using localhost (http://localhost/dojotrunk/demos/mobileGallery/demo-iphone.html on my installation). Can this be caused by not up-to-date cache, or something like that?

BTW, what is the version of your Apache server? Do you still have its installer somewhere?

Thanks.

comment:8 Changed 7 years ago by Adrian Vasiliu

I reproduce on Chrome 19 on Vista (Thinkpad), both the vertical position issue, and the "Reset" button having no effect. I do not reproduce on Firefox 12, nor on a few iPhone or Android devices that I've tried. It seems the problem hurts or not depending on number rounding issues, and maybe on timing/speed issues.

At least for the problem of the "Reset" button/method, the cause appears to be that SpinWheelSlot.spin() has a numeric test to determine whether the spinning animation is ongoing, and this test fails because, in webkit, scrolling.getPos() returns sometimes a "y" value with decimals... The attached patch15403-reset.patch is a simple fix of this issue. Note that this patch only fixes the Reset issue, not the vertical position issue.

Last edited 7 years ago by Adrian Vasiliu (previous) (diff)

Changed 7 years ago by Adrian Vasiliu

Attachment: patch15403-reset.patch added

Fix for reset()/spin() not working in some cases - Adrian Vasiliu, IBM, CCLA

comment:9 Changed 7 years ago by Adrian Vasiliu

To clarify where we are on it: there are two issues reported by EricWang: 1/ The spin wheel sometimes showing the values shifted vertically from their correct position, and 2/ The "reset" button (reset() / spin() functions) doing nothing (Eric mentioned it in a comment).

I have reproduced both, but only on Chrome 19.

Both issues seem related with the fact that, in this webkit browser, we end-up with css3 transforms such as translate3d(0px,3.0000039736430892px,0px) (notice the decimals...). Didn't find docs which would clarify if this is legal or illegal, but for sure this doesn't fail. The legal units are also fuzzily documented. Just removing the "px" didn't do the trick. Another aspect, probably related, is that the itemHeight (for the labels) in this browser is 43, versus 44 in FF, thus leading to decimals when divided by 2 to get the central vertical position. Note that we do have plenty of Math.round in the code involved, and the decimals in the computed translate3d originate at scrollable.getPos() which returns, in this browser, the values from webkit-transform's matrix, which contains such decimals. When running on Android devices (tested on Android 2.2 and 4.0.4), there are no decimals. The trouble is unrelated with the themes (occurs in Chrome with both android and iphone themes).

Now, to solve the first problem (incorrect position), I have tried to round all values (including in scrollable.getPos), or to not round any, plus numerous mixes of both (depending on the operation involved in SpinWheelSlot and in the scrollable parent). Nothing did the trick so far.

So, the attached patch still solves only the "reset" problem (apparently in a safe way). (I've uploaded a new version to include a doc comment for the method overrides).

comment:10 Changed 7 years ago by Adrian Vasiliu

Good to know: the issue hurts on Chrome on some PCs: mine, using Chrome 19.0.1084.52, and EricWang's, while it does not hurt on another PC using exactly the same Chrome version and the same code (running the code remotely from my machine). Screen resolution is slightly different, though, and this is likely to matter, since this is all about decimals and roundings (I reproduce on two screens: 1680x1050, and 1280x1024; not reproduced on 1600x1200).

comment:11 Changed 7 years ago by Adrian Vasiliu

Found out that, at least on my side, the issue only happens if the browser zoom is different than 1:1. Simply pressing Ctrl+0 (zoom reset) fixes it. It is not specific to Chrome, nor to some screen resolutions. Now, using browser's zoom is an action quite usual on desktop browsers, and ideally our widgets shouldn't misbehave because of that. However, the main focus is on mobile browsers where this trouble does not hold.

Last edited 7 years ago by Adrian Vasiliu (previous) (diff)

comment:12 Changed 7 years ago by Eric Durocher

Resolution: wontfix
Status: newclosed

comment:13 Changed 7 years ago by Adrian Vasiliu

The resolution can be changed from wontfix to fixed, because this issue is fixed by the fix of #16766.

comment:14 Changed 7 years ago by cjolif

Milestone: tbd1.9
Resolution: wontfix
Status: closedreopened

comment:15 Changed 7 years ago by cjolif

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.