Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2221] Crash in Kitchen Sink-> Base UI->Views-> Scroll Views->Basic->Scroll to Top

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2013-01-22T18:24:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterAnatoliy Odukha
AssigneeShak Hossain
Created2013-01-02T14:30:43.000+0000
Updated2016-03-08T07:41:13.000+0000

Description

open Kitchen Sink-> Base UI-> Scroll Views->Basic-> and scroll down to button "Scroll to Top" click it there is misprint in Ti/UI/ScroolView.js in scrollTo: scrollTo: function(x, y) { self._setTranslation(x !== null ? -x : this._currentTranslationX, y !== null ? -y : this._currentTranslationX); }, self is undefined at this point, should be this here.

Comments

  1. Mostafizur Rahman 2014-01-02

    Hello, We tested this issue with the test code below. I can’t reproduce this issue in mobile web. Please check following code in latest version. If you use a different test case, please post it here.

    Test Environment

    Titanium SDK: 3.2.0. Titanium CLI: 3.2.0, Google chrome, Firefox Win 7, Mac OS X 10.8.5

    Test Code

       var win = Titanium.UI.createWindow({
       	title : 'scrollView Test'
       });
       
       var scrollView = Titanium.UI.createScrollView({
       	contentWidth : 'auto',
       	contentHeight : 'auto',
       	top : 0,
       	showVerticalScrollIndicator : true,
       	showHorizontalScrollIndicator : true
       });
       
       var view = Ti.UI.createView({
       	backgroundColor : '#336699',
       	borderRadius : 10,
       	width : 300,
       	height : 2000,
       	top : 10
       });
       
       scrollView.add(view);
       
       var button = Titanium.UI.createButton({
       	title : 'Scroll to Top',
       	height : 40,
       	width : 200,
       	bottom : 10
       });
       view.add(button);
       button.addEventListener('click', function() {
       	scrollView.scrollTo(0, 0);
       });
       
       var button2 = Titanium.UI.createButton({
       	title : 'Add to Scroll View',
       	height : 40,
       	width : 200,
       	top : 20
       });
       scrollView.add(button2);
       button2.addEventListener('click', function() {
       	var view = Ti.UI.createView({
       		backgroundColor : 'red',
       		borderRadius : 10,
       		width : 300,
       		height : 300,
       		top : 2020
       	});
       	scrollView.add(view);
       
       });
       
       win.add(scrollView);
       
       win.open();
       
    Thanks
  2. Shak Hossain 2014-01-15

    Closing since the issue is not reproducible with 3.2 TISDK.

JSON Source