-
Notifications
You must be signed in to change notification settings - Fork 648
Fix positioning of Autocomplete overlay menu when tokens are present #7431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix positioning of Autocomplete overlay menu when tokens are present #7431
Conversation
🦋 Changeset detectedLatest commit: 077df7f 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 |
|
👋 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 |
There was a problem hiding this 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 |
9987e0b to
a2fd844
Compare
liuliu-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! ✨
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/10178 |
Closes https://github.com/github/primer/issues/5261
Changelog
Changed
Rollout strategy
Testing & Reviewing
Merge checklist