Skip to content

fix: branch selector dropdown clipping and scroll reset on tab switch#336

Open
AbhiVarde wants to merge 1 commit intobetter-auth:mainfrom
AbhiVarde:fix/branch-selector-scroll-and-height
Open

fix: branch selector dropdown clipping and scroll reset on tab switch#336
AbhiVarde wants to merge 1 commit intobetter-auth:mainfrom
AbhiVarde:fix/branch-selector-scroll-and-height

Conversation

@AbhiVarde
Copy link
Copy Markdown
Contributor

Problem

Two issues with the branch selector dropdown:

  • Dropdown was being clipped by a parent scroll container when there were few files in the repo, making it appear cut off
  • Switching between Branches and Tags tabs preserved the previous scroll position instead of resetting to the top

Solution

  • Changed dropdown from absolute to fixed positioning using triggerRef to calculate the correct viewport position, so it always renders above parent scroll containers
  • Added listRef to the scrollable list and reset scroll to 0 on each tab switch via scrollTo(0, 0)

Files Changed

  • apps/web/src/components/repo/branch-selector.tsx

Screenshots

Before After

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 28, 2026

@AbhiVarde is attempting to deploy a commit to the better-auth Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant