{ "id": "62048", "key": "TIMOB-1416", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11240", "name": "Release 1.6.0 M07", "archived": true, "released": true, "releaseDate": "2011-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:56:07.000+0000", "created": "2011-04-15T02:51:46.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "ios", "order", "release-1.6.0", "view", "zindex" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:56:07.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
The following is a quick drag and drop case. You can make this\nwork by removing and re-adding the view, but then you have to\nuntouch and retouch the object. That part is not in this code, but\nshould be enough to demonstrate the issue. Please see code\ncomments.
\nI have a workaround for this, but the performance is pretty\nterrible on device (iPad), using extra views.
\n\nvar win = Ti.UI.createWindow();\nvar v01 = Ti.UI.createView({ name:\"v01\", width:100, height:100, left:0, backgroundColor:\"#f00\", zIndex:0 });\nvar v02 = Ti.UI.createView({ name:\"v02\", width:100, height:100, right:0, backgroundColor:\"#0f0\", zIndex:0 });\nvar vCont = Ti.UI.createView({ width:200, height:100, backgroundColor:\"#00f\" });\n\nwin.open(); win.add(vCont); vCont.add(v01); vCont.add(v02);\n\nfunction dropView(e) {\n e.source.addEventListener(\"touchstart\", selectView);\n e.source.removeEventListener(\"touchmove\", moveView);\n e.source.removeEventListener(\"touchend\", dropView);\n e.source.zIndex = 0;\n}\n\nfunction moveView(e) {\n // un-comment the next two lines to see it working\n // vCont.remove(e.source); vCont.add(e.source);\n // e.source.width = 150;\n \n // comment the next line, if un-commenting the top two\n e.source.center = {x:e.x + e.source.animatedCenter.x - e.source.width / 2};\n}\n\nfunction selectView(e) {\n e.source.zIndex = 1;\n Ti.API.info(\"Evt Source: \" + e.source.zIndex);\n Ti.API.info(v01.name + \" zIndex: \" + v01.zIndex);\n Ti.API.info(v01.name + \" zIndex: \" + v02.zIndex);\n e.source.removeEventListener(\"touchstart\", moveView);\n e.source.addEventListener(\"touchmove\", moveView);\n e.source.addEventListener(\"touchend\", dropView);\n}\n\n\nv01.addEventListener(\"touchstart\", selectView);\nv02.addEventListener(\"touchstart\", selectView);
\n
See issue 775:
\n\nhttps://appcelerator.lighthouseapp.com/projects/32238-titanium-mobi...
\nNeat trick with the view bouncing, tho, not a particularly nice\nsolution.
FYI, is this a dupe?
\n\nhttps://appcelerator.lighthouseapp.com/projects/32238-titanium-mobi...
(from [48efc48d8a2d072fbe5347247fb3748a809cc582])\n[#775\nstatus:fixed-in-qa] [#1426 status:fixed-in-qa] [#1416\nstatus:fixed-in-qa] zIndex sorting must happen in the parent of the\nview whose zIndex changed. \nhttp://github.com/appcelerator/titanium_mobile/commit/48efc48d8a2d0...
(from [6a5a8a1cd4fe1e05fbfcfb076d3a1bdb9238d27b])\n[#775\nstatus:fixed-in-qa] [#1426 status:fixed-in-qa] [#1416\nstatus:fixed-in-qa] zIndex sorting must happen in the parent of the\nview whose zIndex changed. \nhttp://github.com/appcelerator/titanium_mobile/commit/6a5a8a1cd4fe1...
(from [483124c7082e31db4e80b3de4739f7eeb703da27])\n[#2183 state:fixed-in-qa] [#775\nstate:fixed-in-qa] [#2092 state:fixed-in-qa] [#1426\nstate:fixed-in-qa] [#1416 state:fixed-in-qa] This time, zIndex is\nfixed for sure! Really now! Honest! \nhttp://github.com/appcelerator/titanium_mobile/commit/483124c7082e3...
Mea culpa. This is because setZIndex is expecting an int, but we\npass an object. The workaround is to do view.animate({zIndex:});\nwhich does a different code path.
\nThe fix will be in KrollObject.m, lines 793:
\n\n selector = NSSelectorFromString([NSString stringWithFormat:@\"set%@:\",name]);\n if ([target respondsToSelector:selector])\n {\n [target performSelector:selector withObject:value];\n }\n else \n {\n [target setValue:value forKey:key];\n }
\n
\nReplace with [target setValue:value forKey:key];, since it will\ncheck for setFoo anyways, and faster. Since we're so close to\n1.5.0, pushing to 1.5.1.
(from [97ef54ba316f4b52d6e9aecb50977d4561d87c89])\n[#1416 state:fixed-in-qa] checking for setFoo was\nredundant and didn't account for non-object arguments \nhttps://github.com/appcelerator/titanium_mobile/commit/97ef54ba316f...
(from [e8a8ee647699f2ab443583a300b0da3eabb5d863])\nRevert \"[#1416 state:fixed-in-qa] checking for setFoo was\nredundant and didn't account for non-object arguments\"
\nThis reverts commit\n97ef54ba316f4b52d6e9aecb50977d4561d87c89.
\n\nhttps://github.com/appcelerator/titanium_mobile/commit/e8a8ee647699...
(from [c4cca8b8dc8b30af5883ecce20e328fd830b1f2e])\nRevert \"Revert \"[#1416 state:fixed-in-qa] checking for setFoo was\nredundant and didn't account for non-object arguments\"\"
\nThis reverts commit\ne8a8ee647699f2ab443583a300b0da3eabb5d863.
\n\nhttps://github.com/appcelerator/titanium_mobile/commit/c4cca8b8dc8b...
Fix moved from master. It's still open again.
(from [a418c7495fa816675b62f2b2580da0e61ce3840b])\n[#1416 state:fixed-in-qa] Ensuring that zIndex is\nsetValue:forKey:ed. \nhttps://github.com/appcelerator/titanium_mobile/commit/a418c7495fa8...
Test is put into Integrity. Unclear on the behavior expected and\nhow to validate fix.
Tested simulator 4.2.1 release, iPod 3GT 4.2.1 release. Behavior\nis as expected.