Skip to content

RG-2773 Fix empty row on scroll up in dropdown#9261

Open
Hypnosphi wants to merge 3 commits intomasterfrom
air/https-youtrack.jetbrains.com-issue-rg-2773-ringui-empty-row-appe-b402cf83-1
Open

RG-2773 Fix empty row on scroll up in dropdown#9261
Hypnosphi wants to merge 3 commits intomasterfrom
air/https-youtrack.jetbrains.com-issue-rg-2773-ringui-empty-row-appe-b402cf83-1

Conversation

@Hypnosphi
Copy link
Copy Markdown
Contributor

@Hypnosphi Hypnosphi commented Apr 10, 2026

Summary

  • Use IntersectionObserver on the List container to detect invisible→visible transitions and call recomputeRowHeights(), fixing stale row height cache from react-virtualized that caused a phantom empty row when scrolling up in a dropdown
  • Mark the unused visible prop as @deprecated for removal in Ring UI 8.0

Test plan

  • Run existing list tests (npx jest src/list/)
  • Run select tests (npx jest src/select/)
  • Manual: open a dropdown with a long list, scroll down, close, reopen, scroll up — no empty row should appear

🤖 Generated with Claude Code

…ghts on visibility change

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 10, 2026 18:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 IntersectionObserver on the list container to detect invisible→visible transitions and call recomputeRowHeights().
  • Disconnect the observer on unmount to avoid leaks.
  • Mark ListProps.visible as @deprecated with a planned removal in Ring UI 8.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hypnosphi Hypnosphi marked this pull request as draft April 10, 2026 18:12
Hypnosphi and others added 2 commits April 10, 2026 20:20
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>
@Hypnosphi Hypnosphi marked this pull request as ready for review April 10, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants