chore: expose utils in entry file
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { isIOS as checkIsIOS } from '../validate/system';
|
||||
|
||||
type ScrollElement = HTMLElement | Window;
|
||||
|
||||
function isWindow(val: unknown): val is Window {
|
||||
@@ -56,3 +58,13 @@ export function getVisibleTop(el: ScrollElement) {
|
||||
}
|
||||
return el.getBoundingClientRect().top;
|
||||
}
|
||||
|
||||
const isIOS = checkIsIOS();
|
||||
|
||||
// hack for iOS12 page scroll
|
||||
// see: https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
|
||||
export function resetScroll() {
|
||||
if (isIOS) {
|
||||
setRootScrollTop(getRootScrollTop());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user