Virtualized Picker recalculates its layout several times for each visible option when it opens
メンテナーはふだん 1 日以内に返信
@mangeshraut712 がすでに取り組んでいます。
2026年10月27日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend, performance
調査の方向性
Start by reading useVirtualizerItem and tracing its calls to isElementVisible() and getSize(); reproduce the Picker opening with the linked demo and inspect the Chrome Performance recording. The issue describes measuring visible options in a shared pass. Done looks like one layout measurement pass for the visible options and fewer repeated style recalculations and layouts.
索引モデルが issue の本文から書いたものです。
説明
Provide a general summary of the issue here
When a Picker opens, the browser works out the page's styles and layout several times for each visible option before the list can be drawn, because useVirtualizerItem measures each option separately.
🤔 Expected Behavior?
Opening the Picker should work out the layout once for all the visible options, not repeatedly for each one.
😯 Current Behavior
useVirtualizerItem measures each visible option in its own layout effect. For each one, isElementVisible() calls checkVisibility(), then getSize() clears node.style.height, reads scrollWidth and scrollHeight, and then sets the height value back again. Because each option changes a style and then reads a size, the browser works out the styles and layout again, several times for every option.
In a Chrome developer tools Performance panel recording of it opening, rendering 17 visible options took 133 layouts and about 150 style recalculations. With the CPU slowed down 4x in Chrome 155, the Picker took 227ms to open, and the page became unresponsive for 162ms of that time. It takes about the same time with 125 items as with 250, so it isn't the number of items that's the problem.
💁 Possible Solution
Measure the visible options in one pass. Clear the heights of all the options that need measuring first, then read all their sizes, then put the
heights back, so the browser only works out the layout once.
🔦 Context
I was measuring how quickly some different design systems open a country selector, with the CPU slowed down 4x to roughly match a mid-range phone. React Spectrum's Picker uses virtualization, so I expected it to be one of the fastest, but it was the second slowest to open, and the page was unresponsive for 162ms of the time it took to open up.
On lower-end devices, that pause comes straight after the user clicks the Picker, so it makes the whole app feel slow to respond. Since the issue doesn't depend on the number of items, it affects every Picker, not just ones with long lists, and a fix in seVirtualizerItem would help any app that uses it.
🖥️ Steps to Reproduce
- Clone the reproduction repo I made here: https://github.com/denodell/react-spectrum-picker-open-repro
- Run
npm install, thennpm start, and open the page it serves. - In the Performance panel of Chrome's developer tools, set CPU throttling to 4x and press Record.
- Click the Picker to open it, then stop the recording.
- The main thread shows a long run of short Recalculate style and Layout events, and in the "Bottom-Up" tab, notice that
checkVisibilityis near the top, called fromisElementVisibleinuseVirtualizerItem.
Version
@adobe/react-spectrum 3.47.6, react-aria 3.53.0, React 19.3.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS Golden Gate
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
- 主要言語
- TypeScript
- スター
- 16k
- フォーク
- 1.6k
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
adobe/react-spectrum のほかの issue
-
accessibility bug PreviewTrigger
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
adobe/react-spectrum#10917 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unit対応中かも @darshpatel1052 が 2 日前に担当しました。 オープンwaiting on author
難易度 2/5 1時間未満 初心者へのやさしさ 88/100
adobe/react-spectrum#10909 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
DatePicker omits timezone for initially empty fields despite zoned placeholderValue対応中かも @mrlexcoder が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
adobe/react-spectrum#10900 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Separator adds a redundant role="separator" to its default <hr>対応中かも @Janani-bn が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
adobe/react-spectrum#10894 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
ComboBox with selectionMode="multiple": Cmd/Ctrl+A does nothing while the popover is open対応中かも @mangeshraut712 が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
adobe/react-spectrum#10866 ·
メンテナーはふだん 1 日以内に返信
adobe/react-spectrum の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vercel-labs/durable-harness#53 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
area/docs area/ui enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
melgarafael/DeskcommCRM#4098 ·
メンテナーはふだん 1 日以内に返信
-
bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
kerti/balances-v2#801 ·
メンテナーはふだん 1 日以内に返信
-
lesson-submission pending-review
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
Ikalus1988/MisakaNet#4510 ·
メンテナーはふだん 1 日以内に返信