Chore: add custom selectpanel event#3919
Merged
francinelucca merged 20 commits intomainfrom Feb 11, 2026
Merged
Conversation
…onents into chore/add-treeview-role
…onents into chore/add-treeview-role
…onents into chore/add-treeview-role
🦋 Changeset detectedLatest commit: bd75545 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 |
…dd-custom-selectpanel-event
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new custom event around SelectPanel invoker activation so consumers can observe invoker interactions even though the original activation event is prevented/stopped from bubbling.
Changes:
- Dispatch a new custom event during SelectPanel invoker activation handling.
- Add system tests asserting the new event fires on click, keyboard activation, and bubbles.
- Add a changeset entry and apply a small string-quote/style tweak in a TreeView system test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
app/components/primer/alpha/select_panel_element.ts |
Dispatches a new custom event when the invoker is activated. |
test/system/alpha/select_panel_test.rb |
Adds system tests to validate the new invoker event behavior (click, keyboard, bubbling). |
test/system/alpha/tree_view_test.rb |
Minor string quoting/style adjustment. |
.changeset/rare-jokes-scream.md |
Documents the change as a patch release. |
Comments suppressed due to low confidence (1)
app/components/primer/alpha/select_panel_element.ts:817
- This custom event fires for both mouse click and keyboard activation (Enter), so the name/comment "invokerClicked" is misleading. Consider renaming the event (and related test names) to reflect activation rather than a pointer click.
// Let listeners observe the invoker was clicked
this.invokerElement?.dispatchEvent(new CustomEvent('invokerClicked', {bubbles: true}))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TylerJDev
approved these changes
Feb 11, 2026
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.
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
Adds a new "invokerClicked" custom event to SelectPanel before stopping propagation of original event so that consumers can subscribe to SelectPanel activation
Integration
N/A
List the issues that this change affects.
Closes https://github.com/github/primer/issues/6372
Risk Assessment
What approach did you choose and why?
Anything you want to highlight for special attention from reviewers?
Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.