Skip to content

Commit eb4d4ce

Browse files
committed
fix(iOS scroll penetration): fix the iOS scroll penetration and remove the release.yml
1 parent 9122c61 commit eb4d4ce

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AnyWeb JS SDK
22

3-
AnyWeb JS SDK 是为 Anyweb 开发的SDK,提供了一套简单的API,方便开发者快速将 Dapp 接入到 AnyWeb 中实现便捷的钱包服务。
3+
AnyWeb JS SDK 是为 [Anyweb](https://anyweb.cc) 开发的SDK,提供了一套简单的API,方便开发者快速将 Dapp 接入到 AnyWeb 中实现便捷的钱包服务。
44

55
Features:
66

src/utils/common.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export interface IIframeOptions {
3636

3737
const setBodyNonScrollable = () => {
3838
document.body.style.overflow = 'hidden'
39+
const scrollTop =
40+
document.body.scrollTop || document.documentElement.scrollTop
41+
document.body.style.cssText +=
42+
'position:fixed;width:100%;top:-' + scrollTop + 'px;'
3943
document.addEventListener(
4044
'touchmove',
4145
(e) => {
@@ -47,6 +51,11 @@ const setBodyNonScrollable = () => {
4751

4852
const setBodyScrollable = () => {
4953
document.body.style.overflow = ''
54+
document.body.style.position = ''
55+
const top = document.body.style.top
56+
document.body.scrollTop = document.documentElement.scrollTop = -parseInt(top)
57+
document.body.style.top = ''
58+
5059
document.removeEventListener('touchmove', (e) => {
5160
e.stopPropagation()
5261
})

0 commit comments

Comments
 (0)