RG-2773 Fix empty row on scroll up in dropdown#9261
Open
RG-2773 Fix empty row on scroll up in dropdown#9261
Conversation
…ghts on visibility change Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a dropdown rendering glitch by refreshing react-virtualized row height calculations when the list transitions from not visible to visible again, and begins deprecating the now-unused visible prop on List.
Changes:
- Add an
IntersectionObserveron the list container to detect invisible→visible transitions and callrecomputeRowHeights(). - Disconnect the observer on unmount to avoid leaks.
- Mark
ListProps.visibleas@deprecatedwith a planned removal in Ring UI 8.0.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Feature-detect IntersectionObserver before use (SSR/older browsers) - Only create observer when renderOptimization is enabled - Add tests for mount without IntersectionObserver, invisible→visible transition, and no-op when already visible Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IntersectionObserveron the List container to detect invisible→visible transitions and callrecomputeRowHeights(), fixing stale row height cache fromreact-virtualizedthat caused a phantom empty row when scrolling up in a dropdownvisibleprop as@deprecatedfor removal in Ring UI 8.0Test plan
npx jest src/list/)npx jest src/select/)🤖 Generated with Claude Code