You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
The code below found in $anchorScrollProvider forces the Android address bar to show. The scroll method is called every time angular changes views, which causes this issue. While iOS and other browsers allow 0 in the scrollTo method, Android allows only positive integers for the desired behavior (http://mobile.tutsplus.com/tutorials/mobile-web-apps/remove-address-bar/).
function scroll() {
var hash = $location.hash(), elm;
// empty hash, scroll to the top of the page
if (!hash) $window.scrollTo(0, 0);
// element with given id
else if ((elm = document.getElementById(hash))) elm.scrollIntoView();
// first anchor with given name :-D
else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView();
// no element and hash == 'top', scroll to the top of the page
else if (hash === 'top') $window.scrollTo(0, 0);
}
Our fix is to wrap window's scrollTo method and check if the device is an Android. If it is an android and the x, y arguments are 0, 0, we manually set the value to 0, 1.
window.aliasedScrollTo = window.scrollTo
window.scrollTo = (x, y, delay) ->
if Device.android() && x == 0 && y == 0
window.aliasedScrollTo(x, 1, delay)
else
window.aliasedScrollTo(x, y, delay)
Is there a better solution for this problem?
The text was updated successfully, but these errors were encountered:
The code below found in $anchorScrollProvider forces the Android address bar to show. The scroll method is called every time angular changes views, which causes this issue. While iOS and other browsers allow 0 in the scrollTo method, Android allows only positive integers for the desired behavior (http://mobile.tutsplus.com/tutorials/mobile-web-apps/remove-address-bar/).
Our fix is to wrap window's scrollTo method and check if the device is an Android. If it is an android and the x, y arguments are 0, 0, we manually set the value to 0, 1.
Is there a better solution for this problem?
The text was updated successfully, but these errors were encountered: