File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const scrollingEffectClassNameReg = new RegExp(
19
19
) ;
20
20
21
21
let scrollPosition = 0 ;
22
+ const isIosDevice = / i P ( a d | h o n e | o d ) | M a c I n t e l / . test ( window . navigator . platform ) ;
22
23
23
24
const setContainerStyle = (
24
25
container : HTMLElement ,
@@ -31,7 +32,6 @@ const setContainerStyle = (
31
32
overflowY : 'hidden' ,
32
33
} ;
33
34
34
- const isIosDevice = / i P ( a d | h o n e | o d ) | M a c I n t e l / . test ( window . navigator . platform ) ;
35
35
if ( isIosDevice && container === document . body ) {
36
36
scrollPosition = window . pageYOffset ;
37
37
return {
@@ -158,7 +158,7 @@ export default class ScrollLocker {
158
158
159
159
setStyle ( cacheStyle . get ( container ) , { element : container } ) ;
160
160
// https://github.com/ant-design/ant-design/issues/23202
161
- if ( container === document . body ) {
161
+ if ( isIosDevice && container === document . body ) {
162
162
window . scrollTo ( 0 , scrollPosition ) ;
163
163
}
164
164
cacheStyle . delete ( container ) ;
You can’t perform that action at this time.
0 commit comments