[TIMOB-15780] Android: ScrollableView.setCurrentPage() fires "scrollend" event when it shouldn't
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-09T21:30:16.000+0000 |
Affected Version/s | Release 3.2.0 |
Fix Version/s | Release 7.3.0 |
Components | Android |
Labels | android, events, module_scrollableview, qe-closed-3.3.0, qe-testadded, scrollableView, triage |
Reporter | Lee Driscoll |
Assignee | Joshua Quick |
Created | 2013-10-30T14:49:34.000+0000 |
Updated | 2018-06-26T18:26:42.000+0000 |
Description
The setCurrentPage method for Ti.UI.ScrollableView fires the 'dragend' & 'scrollend' events upon completion.
According to the docs:
scrollend: Fired when the view has stopped moving completely.
dragend: Fired when the scrolling drag gesture on the view has been completed.
If setCurrentPage is called programmatically, the 'dragend' event is incorrect as no drag gesture has been occurred.
If setCurrentPage is called programmatically and without animation, the 'scrollend' event is incorrect as no movement has occurred.
Attachments
File | Date | Size |
---|---|---|
ScrollableViewAddRemoveTest.js | 2018-05-04T00:21:34.000+0000 | 3657 |
Hi Lee Driscoll, Could you share full test case so that i paste into the app.js file and can check it. Thanks
when you say app.js I'm assuming you're talking about the index.js file? Sorry, I've only worked on alloy projects.
Tested on simple commonjs app and the event does not fire; works as expected:
Discard last comment, I was testing on iPhone. Tested on Android and was able to reproduce it.
PR pending: https://github.com/appcelerator/titanium_mobile/pull/5031
Verified with test environment: Appc-Studio:3.3.0.201404211130 sdk:3.3.0.v20140423155715 acs:1.0.14 alloy:1.4.0-dev npm:1.3.2 titanium:3.3.0-dev titanium-code-processor:1.1.1-beta1 xCODE:5.1.1 Device:Iphone5(7.1),LG-P970(v4.0.4) setCurrentPage() Method for scrollable View working fine.
Re-opening since this issue has not been resolved on Android. The "scrollend" event still gets fired when calling setCurrentPage(). The "dragend" event does not get fired. (This is good.) I was able to reproduce the above in Titanium 6.0.2 and 7.0.1. *Test Code:*
*Side Note:* Both Android and iOS fire a single "scroll" event after calling setCurrentPage(). I don't agree with this behavior, but at least the 2 platforms are consistent.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696
FR Passed. Waiting for merger to be enabled.
PR Merged.
*Closing ticket.* The fix is present in SDK: {noformat} 7.3.0.v20180626064422 {noformat}