Document the indexAttribute option and cover it with a test
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 78/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- documentation, testing
研究方向
從 docs/api/virtualizer.md 和 docs/framework/marko/marko-virtual.md 中現有的 indexAttribute 項目開始,接著檢查 packages/virtual-core/tests,了解核心虛擬器的測試模式。說明預設值、measureElement 和 resize observer 對它的使用方式,以及共用元素的網格情境;新增一個測試,其中列虛擬器和欄虛擬器使用不同的屬性。文件和測試涵蓋要求的行為後,即視為完成。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
The indexAttribute option of Virtualizer (default 'data-index') is public API in VirtualizerOptions and is documented only for the Marko adapter. It is missing from docs/api/virtualizer.md, so nothing on the core options page explains how to measure the same element with two virtualizers (for example a row and a column virtualizer in a grid). Without it, both virtualizers read the same data-index attribute and the second one measures the wrong index.
There is also no test in packages/virtual-core/tests that exercises a custom indexAttribute, so the behavior could regress unnoticed.
Your minimal, reproducible example
Search the docs for indexAttribute: it only appears in docs/framework/marko/marko-virtual.md.
Steps to reproduce
- Open
docs/api/virtualizer.md. - Look for
indexAttributeamong the options.
Expected behavior
The option is documented with its default, how it is used by measureElement and the resize observer, and the two-virtualizer grid use case. A core test covers a row and a column virtualizer measuring one shared element through distinct attributes.
How often does this bug happen?
Every time
Platform
Any
tanstack-virtual version
@tanstack/virtual-core 3.19.11 (main)
Additional context
Docs and test only; no published code changes.
- 主要語言
- TypeScript
- 星號
- 7.2k
- 分支
- 495
- 平均合併
- 15 小時 11 分鐘
- 30 天內合併 PR
- 17
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TanStack/virtual 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 55/100
維護者通常 1 天內回覆
-
With `useScrollendEvent`, scrollToIndex and scrollToEnd stop short when the target moves while they settle可能已有人在做 @Darkatse 於 11 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 25/100
維護者通常 1 天內回覆
-
svelte-virtual renders no rows when the scroll element is bound after the store subscribes可能已有人在做 @clean99 於 15 天前認領。 未關閉
難度 4/5 1-2 天 新手友好度 35/100
維護者通常 1 天內回覆
-
anchorTo: 'end' does not keep the reading position when only paddingStart changes可能已有人在做 @duongynhi000001-crypto 於 15 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 30/100
維護者通常 1 天內回覆
-
anchorTo: 'end' loses the end when the scroll element shrinks可能已有人在做 @langleyd 於 44 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 68/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
fb55/htmlparser2#2579 ·
維護者通常 1 天內回覆
-
bug good first issue needs-review
難度 1/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
documentation public
難度 1/5 1-3 小時 新手友好度 68/100
midnightntwrk/umbradb#65 ·
維護者通常 2 天內回覆
-
area/channels kind/bug priority/medium
難度 2/5 1-3 小時 新手友好度 78/100
nanocoai/nanoclaw#4501 · 1 則留言 ·
維護者通常 1 天內回覆
-
needs verification
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 13 天內回覆