GWT with JSNI, incorrect window.pageYOffset value

My Vaadin component’s client GWT component uses JSNI to invoke a native java script funtion.

GWT code that uses JSNI to invoke a JavaScript is:


	private native String getScrollInfo() /*-{
		return $wnd.getScrollInfo();
	}-*/;

And my JavaScript is:


function getScrollInfo(){
	if (window.innerWidth) { // all but IE
		return ("window.pageYOffset = " + window.pageYOffset);
	} 
}

When invoked the JavaScript executes fine, but the value of
window.pageYOffset
is zero always.

Any help would be appreciated.


Already replied to the similar question on another thread
.

But the issue might be that in Vaadin apps, by default, the main window scrollbars don’t apply to the body/document element, but to the .v-view element.