Fix ScrollContainer scroll buttons not reflecting overflow immediately#4414
Merged
Conversation
The scroll-further buttons relied on scroll/resize events to detect overflow, so they lagged behind content changes (e.g. new search results) until a manual scroll or window resize fired. Measure synchronously on mount/content change and observe children as well as the container so overflow is detected right away.
Extract scroll overflow tracking into a custom hook to improve reusability and ensure overflow is detected immediately when content changes. Add test ID to ScrollContainer for better e2e testability. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: e432c13 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
tgargula
commented
Jul 17, 2026
gregberge
approved these changes
Jul 17, 2026
Measure on every render instead of tracking children dependency. This ensures overflow state is always in sync with the current DOM without needing to manually track prop changes. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…IO/gitbook into tomasz/fix-scroll-further-button
gregberge
reviewed
Jul 17, 2026
Remove flaky internal.spec.ts scroll test and the SearchFrame ref export that was only needed for testing, reducing test burden while keeping the useScrollOverflow hook logic intact. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
tgargula
enabled auto-merge (squash)
July 20, 2026 08:03
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
Extracted scroll overflow tracking into a custom hook (
useScrollOverflow) to improve code reuse and ensure overflow state is detected immediately when content changes dynamically. This fixes the "Scroll further" button in search results not appearing right away for overflowing content.Changes
useScrollOverflowhook to centralize scroll position and overflow trackingScrollContainerto use the new hookScrollContainerfor improved e2e test selectorsDemo
Before
Screen.Recording.2026-07-17.at.12.55.25.mov
After
Screen.Recording.2026-07-17.at.12.56.12.mov
E2E tests
🤖 Generated with Claude Code
resolves RND-11974