-
Notifications
You must be signed in to change notification settings - Fork 611
SelectPanel: Add new prop align
to SelectPanel
#6183
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?
Conversation
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
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 introduces a new align
prop for SelectPanel
to control its horizontal position relative to the anchor element.
- Adds
align
to theSelectPanelBaseProps
interface and forwards it toAnchoredOverlay
. - Updates the documentation JSON to include the new
align
prop. - Adds a changeset for a minor release.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/react/src/SelectPanel/SelectPanel.tsx | Added optional align prop and passed it into AnchoredOverlay . |
packages/react/src/SelectPanel/SelectPanel.docs.json | Documented the new align prop with its type, default, and description. |
.changeset/fluffy-baboons-sip.md | Added a changeset entry marking this as a minor release. |
Comments suppressed due to low confidence (3)
packages/react/src/SelectPanel/SelectPanel.tsx:186
- [nitpick] To make the default alignment explicit in the component API, consider assigning a default value (e.g.,
align = 'start'
) when destructuring the props.
align,
packages/react/src/SelectPanel/SelectPanel.tsx:632
- There are no tests covering the new
align
prop. Consider adding unit or integration tests to verify the panel’s positioning for differentalign
values.
align={align}
packages/react/src/SelectPanel/SelectPanel.docs.json:196
- [nitpick] The
defaultValue
entry includes single quotes inside the JSON string, which may render extra quotes in the generated docs. Consider using"defaultValue": "start"
for clarity.
"defaultValue": "'start'",
size-limit report 📦
|
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.
✨
@@ -108,6 +108,7 @@ interface SelectPanelBaseProps { | |||
* @default undefined (uses feature flag default) | |||
*/ | |||
disableFullscreenOnNarrow?: boolean | |||
align?: AnchoredOverlayProps['align'] |
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.
nit: could add to Pick<> in line 119 instead
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.
Oh wow, didn't even realize! thank you for the suggestion! 🙏
🦋 Changeset detectedLatest commit: 354d5e7 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 |
Closes https://github.com/github/primer/issues/5294
Adds prop
align
toSelectPanel
to allow consumers to adjust where theSelectPanel
will be upon opening.Changelog
New
align
toSelectPanel
Rollout strategy
Testing & Reviewing
Merge checklist