-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrollView下拉刷新动画错位 #11394
Labels
Comments
taro-bot2
bot
added
F-react
Framework - React
T-weapp
Target - 编译到微信小程序
V-3
Version - 3.x
labels
Mar 4, 2022
等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!
Thank you so much! |
感觉和微信小程序的模板 diff 有关,暂时可以通过增加一层 export default function Test() {
const [show, setShow] = useState(false)
return (
<View>
<View>
<ScrollView
style={{ width: '100%', height: 400, display: !show ? 'block' : ' none' }}
scrollY
refresherEnabled
refresherBackground='green'
>
<View>22222</View>
<View>22222</View>
<View>22222</View>
<View>22222</View>
</ScrollView>
</View>
<View>
{
show && (
<ScrollView style={{ width: '100%', height: 400 }} scrollY refresherEnabled>
<View>11111</View>
<View>11111</View>
<View>11111</View>
<View>11111</View>
</ScrollView>
)
}
</View>
<Button onClick={() => setShow(!show)}>{show ? '隐藏' : '显示'}</Button>
</View>
)
} 后续会把数组形式的 childNodes 改为对象形式,应该可以解决这个问题。 |
这样确实可以了,感谢! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
相关平台
微信小程序
小程序基础库: 2.22.1
使用框架: React
复现步骤
点击隐藏显示,下拉刷新后在点击隐藏显示
``import { View, Button, ScrollView, Image } from '@tarojs/components'
import { useState } from 'react'
export default function Test() {
const [show, setShow] = useState(false)
return (
<ScrollView
style={{ width: '100%', height: 400, display: !show ? 'block' : ' none' }}
scrollY
refresherEnabled
refresherBackground='green'
>
22222
22222
22222
22222
{
show && (
<ScrollView style={{ width: '100%', height: 400 }} scrollY refresherEnabled>
11111
11111
11111
11111
)
}
<Button onClick={() => setShow(!show)}>{show ? '隐藏' : '显示'}
)
}
``
期望结果
在切换显示与隐藏中下拉刷新动画可以正常显示
实际结果
切换显示隐藏后,动画位置偏移
环境信息
The text was updated successfully, but these errors were encountered: