flushSync warning when using useVritualizer with initialOffset greater than available scroll

未关闭
#651 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript

调研方向

首先运行链接的 CodeSandbox 复现,并检查当 initialOffset 超出 scrollElement 的可用滚动区域时 useVirtualizer 的行为。追踪该条件如何导致 flushSync 警告,然后验证当 offset 超出范围时,复现不再产生错误或警告。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

flushSync warning when calling useVirtualizer with initialOffset greater than available scroll.

Your minimal, reproducible example

https://codesandbox.io/p/devbox/virtualizer-repro-lk332q?file=%2Fsrc%2FApp.tsx

Steps to reproduce
  1. use useVirtualizer with initialOffset greater than the available scroll area in the scrollElement
Expected behavior

No errors/warning should happen.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

OS: Windows
Browser: Firefox 121.0.1 (64-bit), Chrome 121.0.6167.85

tanstack-virtual version

latest

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
主要语言
TypeScript
星标
7.2k
派生
495
平均合并
23 小时 16 分钟
30 天内合并 PR
19

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TanStack/virtual 的其他 Issue

查看 TanStack/virtual 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。