Repository navigation
feat(a11y): allow users to pass custom onclick handler to segmented controls buttons - #1447
Merged
Stefan3002 merged 1 commit intoOct 16, 2026
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Type the callback as a mouse-event handler and forward the click event.
1 open finding
What changed in this PR
Adds optional per-segment click handlers to SegmentedControl, with tests and Storybook examples.
Changes:
- Adds optional
onClickcallbacks to segments. - Invokes callbacks when buttons are clicked.
- Adds test coverage and usage examples.
| File | Summary |
|---|---|
src/components/SegmentedControl/SegmentedControl.tsx |
Adds segment click callback support. |
src/components/SegmentedControl/SegmentedControl.test.tsx |
Tests callback invocation and selection behavior. |
src/components/SegmentedControl/SegmentedControl.stories.tsx |
Demonstrates callback usage. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Stefan3002
force-pushed
the
allow-custom-on-click-segmented-controls
branch
from
October 16, 2026 12:37
17a5e56 to
da8dfc0
Compare
|
🎉 This PR is included in version 4.14.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.

Done
QA
Pinging @canonical/react-library-maintainers for a review.
QA steps
Percy steps
Fixes
Fixes: #AC-4750.