PDA

View Full Version : Iphone issue: scroll List wrong Height



katamshut
2 Oct 2011, 9:02 AM
Hi

I face a strange behavior in Iphone 4. I tested with chrome, safari (on PC) and Iphone 4. The behavior in Iphone 4 is diffrent then in the browsers on PC. I have List and want to scroll to the last item. But the Height of the List Component is over 2000 px over the real height. This makes the scroll scrolling to an unreal value. Here the scroll event which scrolls on every list refresh:



refresh: function(){
console.log('refresh');
var index = this.getTargetEl().dom.clientHeight - this.getHeight();
if(index>0){
this.scroller.updateBoundary();
console.log('I scroll to: ' + index);
console.log('this.getTargetEl().dom.clientHeight: ' + this.getTargetEl().dom.clientHeight);
console.log('this.getHeight(): ' + this.getHeight());
console.log('this.scroller.container.dom.scrollHeight: ' + this.scroller.container.dom.scrollHeight);
console.log('scroller offsetBoundaries: ' + this.scroller.offsetBoundary[1]);
this.scroller.scrollTo({
x: 0,
y: index
},true);
}
}


and here the above output in chrome:



refresh

ux-chatPanel.js:273 (http://localhost/workspace/jagit/res/ux-chatPanel.js)I scroll to: 3609
ux-chatPanel.js:274 (http://localhost/workspace/jagit/res/ux-chatPanel.js)this.getTargetEl().dom.clientHeight: 3960
ux-chatPanel.js:275 (http://localhost/workspace/jagit/res/ux-chatPanel.js)this.getHeight(): 351
ux-chatPanel.js:276 (http://localhost/workspace/jagit/res/ux-chatPanel.js)this.scroller.container.dom.scrollHeight: 3960
ux-chatPanel.js:277 (http://localhost/workspace/jagit/res/ux-chatPanel.js)scroller offsetBoundaries: -3609




and here the above output in Iphones 4 safari:



refresh

ux-chatPanel.js:273 (http://localhost/workspace/jagit/res/ux-chatPanel.js)I scroll to: 5295

ux-chatPanel.js:274 (http://localhost/workspace/jagit/res/ux-chatPanel.js)this.getTargetEl().dom.clientHeight: 5609

ux-chatPanel.js:275 (http://localhost/workspace/jagit/res/ux-chatPanel.js)this.getHeight(): 314

ux-chatPanel.js:276 (http://localhost/workspace/jagit/res/ux-chatPanel.js)this.scroller.container.dom.scrollHeight: 5609

ux-chatPanel.js:277 (http://localhost/workspace/jagit/res/ux-chatPanel.js)scroller offsetBoundaries: -5295




this makes the Iphone 4 showing an empty list screen which is no more scrollable.

Is this an known issue or have I found a bug here?

cheers
Chris