Skip to content
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

[PullDownRefresh 下拉刷新] scroll-view滚动scrollTop不准确 #2435

Closed
KwongSum opened this issue Nov 15, 2023 · 2 comments · Fixed by #2472
Closed

[PullDownRefresh 下拉刷新] scroll-view滚动scrollTop不准确 #2435

KwongSum opened this issue Nov 15, 2023 · 2 comments · Fixed by #2472
Labels
bug Something isn't working IssueShoot middle middle level of difficulties

Comments

@KwongSum
Copy link

KwongSum commented Nov 15, 2023

tdesign-miniprogram 版本

1.2.3

重现链接

No response

重现步骤

<t-pull-down-refresh
  value="{{enable}}"
  bind:scroll="onScroll"
>
</t-pull-down-refresh>

bindscroll="onScroll" 检测滚动距离

onScroll(e) {
    console.log('滚动距离:'+e.detail)
},

"disableScroll": true,

在快速滑动的情况下,明明已经到顶了但是scrollTop还显示为10~100,
缓慢滑动没有问题,但是快速滚动的时候scrollTop会出现非常大的误差。
微信截图_20231115110751

### 先说我的解决方法

因为每次滚动监听事件都会被调用比较耗费资源系统会默认节流可以在scroll-view 加一个 throttle=“{{false}}” 关闭节流
来源:微信小程序scroll-view滚动scrollTop不准确

期望结果

返回准确scrollTop位置,让我实现动态为Navbar导航栏设置背景颜色

onScroll(e) {
    let opacity = e.detail / 140
    opacity = opacity > 1 ? 1 : opacity
    this.setData({
        opacity : opacity 
      })
},
<view  style="opacity: {{opacity}};"></view>

微信截图_20231115111459
微信截图_20231115111450
微信截图_20231115111758

IssueShoot

  • 预估时长: 3
  • 期望完成时间: 2023-11-30
  • 开发难度: 中
  • 参与人数: 1
  • 验收标准: 实现期望改造效果,提 PR 并通过验收无误
  • 备注: 最终激励以实际提交 pull request 并合并为准
Copy link
Contributor

👋 @KwongSum,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@anlyyao anlyyao added bug Something isn't working middle middle level of difficulties labels Nov 20, 2023
@anlyyao
Copy link
Collaborator

anlyyao commented Nov 20, 2023

@KwongSum 感谢反馈,下个版本带上。 另外,我这边看到你已经查阅有了解决方案,要不要来个🤣,一起共建🏹呢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working IssueShoot middle middle level of difficulties
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants