Skip to content

docs: Document shouldObserveItemSize - #10392

Open
snowystinger wants to merge 2 commits into
mainfrom
document-shouldObserveItemSize
Open

docs: Document shouldObserveItemSize#10392
snowystinger wants to merge 2 commits into
mainfrom
document-shouldObserveItemSize

Conversation

@snowystinger

Copy link
Copy Markdown
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Comment thread packages/dev/s2-docs/pages/react-aria/Virtualizer.mdx Outdated
@rspbot

rspbot commented Jul 29, 2026

Copy link
Copy Markdown

@snowystinger snowystinger added release documentation Improvements or additions to documentation labels Jul 29, 2026
@rspbot

rspbot commented Jul 29, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Jul 29, 2026

Copy link
Copy Markdown

Agent Skills Changes

Modified (4)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/04c528ae0b76e167192dd24400f0fd6caefb2549/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/04c528ae0b76e167192dd24400f0fd6caefb2549/

return (
<div className="expandable-item">
<Text>{item.name}</Text>
<Button onPress={() => setExpanded(!expanded)} aria-label={expanded ? 'Collapse' : 'Expand'}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these repeated primary buttons are kind of a lot. maybe variant=quiet would be better?


<ExampleList tag="virtualizer" pages={props.pages} />

## Items that change size

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move above Examples (Examples is always the last section before API).

Maybe re-title to "Dynamic item sizes"?

Comment on lines +730 to +731
When using a `Virtualizer` with content that can change size, you can tell the `Virtualizer` to observe
the items so that it updates the layout accordingly. This is done by setting the `shouldObserveItemSize` prop.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When using a `Virtualizer` with content that can change size, you can tell the `Virtualizer` to observe
the items so that it updates the layout accordingly. This is done by setting the `shouldObserveItemSize` prop.
Use the `shouldObserveItemSize` prop to automatically re-layout when items change size. Note that this uses a `ResizeObserver` internally and may have performance overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants