{ "id": "170318", "key": "TIMOB-25514", "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": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-16T00:51:16.000+0000", "created": "2017-11-15T04:05:42.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "scrollview" ], "versions": [ { "id": "19542", "description": "", "name": "Release 6.2.2", "archived": false, "released": true, "releaseDate": "2017-09-19" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-11-16T01:55:32.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nThe ScrollView.scrollTo() method, when \"animated\" is set to true, will not always scroll to the given position for \"vertical\" scroll views as of Titanium 6.2.2.\r\n\r\n*Steps to reproduce:*\r\n\r\n# Build and run the below code on Android via Titanium 6.2.2 or higher.\r\n# Scroll down to the bottom of the ScrollView.\r\n# Tap the \"Scroll to Top\" button.\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar scrollView = Ti.UI.createScrollView(\r\n{\r\n\tlayout: \"vertical\",\r\n\tscrollType: \"vertical\",\r\n\tshowHorizontalScrollIndicator: false,\r\n\tshorVerticalScrollIndicator: true,\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.FILL,\r\n});\r\nscrollView.add(Ti.UI.createLabel(\r\n{\r\n\ttext: \"First View\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\tcolor: \"white\",\r\n\tbackgroundColor: \"blue\",\r\n\tborderColor: \"white\",\r\n\tborderWidth: \"1dp\",\r\n\twidth: \"100%\",\r\n\theight: \"75%\",\r\n}));\r\nscrollView.add(Ti.UI.createLabel(\r\n{\r\n\ttext: \"Middle View\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\tcolor: \"white\",\r\n\tbackgroundColor: \"#008800\",\r\n\tborderColor: \"white\",\r\n\tborderWidth: \"1dp\",\r\n\twidth: \"100%\",\r\n\theight: \"75%\",\r\n}));\r\nscrollView.add(Ti.UI.createLabel(\r\n{\r\n\ttext: \"Last View\",\r\n\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\tcolor: \"white\",\r\n\tbackgroundColor: \"purple\",\r\n\tborderColor: \"white\",\r\n\tborderWidth: \"1dp\",\r\n\twidth: \"100%\",\r\n\theight: \"75%\",\r\n}));\r\nwindow.add(scrollView);\r\nvar button = Ti.UI.createButton(\r\n{\r\n\ttitle: \"Scroll To Top\",\r\n\tbottom: \"10dp\",\r\n\tright: \"10dp\",\r\n});\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tscrollView.scrollTo(0, 0, { animated: true });\r\n});\r\nwindow.add(button);\r\nwindow.open();\r\n{code}\r\n\r\n*Result:*\r\nThe ScrollView does not scroll to the top.\r\n\r\n*Expected Result:*\r\nThe scrollTo() method should go to the given position.\r\n\r\n*Notes:*\r\n* The scrollTo() function will work if not set up to be animated.\r\n* The scrollTo() function will work when starting from the top of the ScrollView to scroll down, but is unreliable when called from any other scroll position.\r\n* This is not an issue with horizontal ScrollViews.\r\n* This appears to be a bug in Google's \"NestedScrollView\" Java class. It's smoothScrollTo() and fullScroll() methods are now unreliable, but its non-smooth scrolling methods work fine.\r\n\r\n*Work-Around:*\r\nThe scrollTo() method will work when not set up to be animated, like this...\r\n\r\n{code:javascript}\r\n// Don't do this.\r\n//scrollView.scrollTo(x, y, { animated: true });\r\n\r\n// Do this. It works-around the issue.\r\nscrollView.scrollTo(x, y);\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Vertical ScrollView.scrollTo() goes to wrong position when animated as of 6.2.2", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "430655", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9601", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T05:16:23.000+0000", "updated": "2017-11-15T05:16:23.000+0000" }, { "id": "430706", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed; waiting for CR before merging.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T10:51:28.000+0000", "updated": "2017-11-15T10:51:28.000+0000" }, { "id": "430766", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR merged.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-16T00:51:16.000+0000", "updated": "2017-11-16T00:51:16.000+0000" }, { "id": "430774", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.0.0.v20171115153702.\r\nClosing.\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-16T01:55:27.000+0000", "updated": "2017-11-16T01:55:27.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }