[improvement] extract resetScroll function (#3869)

This commit is contained in:
neverland
2019-07-16 20:56:22 +08:00
committed by GitHub
parent cc445dfc00
commit e653484f39
3 changed files with 20 additions and 17 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* Hack for iOS12 page scroll
* https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
*/
import { isIOS as checkIsIOS } from '../validate/system';
import { getRootScrollTop, setRootScrollTop } from './scroll';
const isIOS = checkIsIOS();
/* istanbul ignore next */
export function resetScroll() {
if (isIOS) {
setRootScrollTop(getRootScrollTop());
}
}