Skip to content

Conversation

@llastflowers
Copy link
Contributor

Closes https://github.com/github/primer/issues/5261

Changelog

Changed

  • Conditionally position the Autocomplete overlay menu when there are tokens present so that the increased height of the input doesn't cause overlapping elements. Storybook story. Should also fix this primer-docs code example.

Before:
Autocomplete With Token Input story before

After:
Autocomplete With Token Input story after

  • While working on this I noticed another Storybook issue and cleaned it up: In the With Callback When Overlay Open State Changes story, there is a state label that changes based on menu open/closed status, but it is positioned so that it is covered up by the menu, so the state change can't be observed. I moved the state label to the right of the input instead, only in this story.

Before:
With Callback When Overlay Open State Changes story before with menu closed
With Callback When Overlay Open State Changes story before with menu open

After:
With Callback When Overlay Open State Changes story after with menu open

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copilot AI review requested due to automatic review settings January 7, 2026 22:12
@llastflowers llastflowers requested a review from a team as a code owner January 7, 2026 22:12
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

🦋 Changeset detected

Latest commit: 077df7f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

@llastflowers llastflowers self-assigned this Jan 7, 2026
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jan 7, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

Copy link
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

This PR fixes the positioning of the Autocomplete overlay menu when tokens are present and improves two Storybook stories for better demonstration. The main change introduces dynamic anchor computation in AutocompleteOverlay to account for token container height, preventing the menu from overlapping with multi-line token inputs.

Key changes:

  • Implements dynamic anchor element selection for Autocomplete overlay positioning based on token presence
  • Improves Storybook story layouts to better visualize component behavior
  • Enhances SelectPanel MultiSelectModal story with clearer state management for saved vs. pending selections

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/react/src/Autocomplete/AutocompleteOverlay.tsx Adds logic to compute anchor element dynamically, positioning menu relative to token container parent when tokens are present
packages/react/src/Autocomplete/Autocomplete.features.stories.tsx Repositions state label in WithCallbackWhenOverlayOpenStateChanges story to be inline with input, preventing menu overlap
packages/react/src/Autocomplete/Autocomplete.features.stories.module.css Adds CSS classes for inline layout of input with state label
packages/react/src/SelectPanel/SelectPanel.features.stories.tsx Refactors MultiSelectModal story to maintain separate saved selection state and only update button text on confirmed selections
.changeset/fresh-spiders-push.md Documents the changes as a patch release

@github-actions github-actions bot requested a deployment to storybook-preview-7431 January 7, 2026 22:17 Abandoned
@llastflowers llastflowers force-pushed the llastflowers/5261/autocomplete-overlay-position-fix branch from 9987e0b to a2fd844 Compare January 7, 2026 22:24
@github-actions github-actions bot temporarily deployed to storybook-preview-7431 January 7, 2026 22:27 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-7431 January 7, 2026 22:38 Inactive
@primer primer deleted a comment from primer-integration bot Jan 7, 2026
@llastflowers llastflowers added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 7, 2026
@primer primer bot requested a review from a team as a code owner January 7, 2026 23:09
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Jan 7, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7431 January 7, 2026 23:20 Inactive
Copy link
Contributor

@liuliu-dev liuliu-dev left a comment

Choose a reason for hiding this comment

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

Looks great! ✨

@primer primer deleted a comment from primer-integration bot Jan 8, 2026
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/10178

@primer-integration
Copy link

🔬 github-ui Integration Test Results

Check Status Details
CI ✅ Passed View run
Projects (Memex) ✅ Passed View run
VRT ✅ Passed View run

All checks passed! Your integration PR is ready for review.

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

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants