-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[improvement] extract resetScroll function (#3869)
- Loading branch information
1 parent
cc445df
commit e653484
Showing
3 changed files
with
20 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |