-
Notifications
You must be signed in to change notification settings - Fork 638
Revert "[a11y] When aria-disabled is set on SegmentedControl, don't allow action" #6986
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
Conversation
…llow act…" This reverts commit f896b37.
|
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 reverts a previous change (#6516) that added accessibility functionality for preventing actions when aria-disabled is set on SegmentedControl components. The revert removes the disabled state handling from SegmentedControl components and restores tooltip feature flag gating.
- Reverts disabled/aria-disabled prop support and associated action prevention logic
- Restores feature flag gating for tooltip functionality in SegmentedControlIconButton
- Removes CSS styling for disabled states and story examples
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx | Removes disabled props, restores feature flag for tooltip behavior |
packages/react/src/SegmentedControl/SegmentedControlIconButton.stories.tsx | Removes disabled props from stories |
packages/react/src/SegmentedControl/SegmentedControlButton.tsx | Removes disabled props and aria-disabled handling |
packages/react/src/SegmentedControl/SegmentedControl.tsx | Removes disabled state checking in onClick handlers |
packages/react/src/SegmentedControl/SegmentedControl.test.tsx | Updates tests for feature flag gating, adds test for non-tooltip behavior |
packages/react/src/SegmentedControl/SegmentedControl.module.css | Removes CSS styling for aria-disabled states |
packages/react/src/SegmentedControl/SegmentedControl.examples.stories.tsx | Removes entire file with disabled button examples |
packages/react/src/SegmentedControl/SegmentedControl.dev.stories.tsx | Removes disabled and aria-disabled story examples |
packages/react/src/FeatureFlags/DefaultFeatureFlags.ts | Adds back primer_react_segmented_control_tooltip feature flag |
.changeset/strong-mangos-rest.md | Removes changeset file |
<span className={clsx(classes.Content, 'segmentedControl-content')}> | ||
{isElement(Icon) ? Icon : <Icon />} | ||
</span> |
Copilot
AI
Oct 11, 2025
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.
Code duplication: The same span with identical structure and content exists on line 70. Consider extracting this into a reusable component or variable to reduce duplication.
Copilot uses AI. Check for mistakes.
? (event: React.MouseEvent<HTMLButtonElement>) => { | ||
const isDisabled = child.props.disabled === true || child.props['aria-disabled'] === true | ||
if (!isDisabled) { | ||
onChange(index) | ||
isUncontrolled && setSelectedIndexInternalState(index) | ||
child.props.onClick && child.props.onClick(event) | ||
} | ||
onChange(index) | ||
isUncontrolled && setSelectedIndexInternalState(index) | ||
child.props.onClick && child.props.onClick(event) |
Copilot
AI
Oct 11, 2025
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.
Missing closing brace: The conditional block starting at line 166 is missing its closing brace, making the code structure unclear and potentially causing syntax errors.
Copilot uses AI. Check for mistakes.
👋 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! |
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/4410 |
FYI @khiga8 @TylerJDev looks like this broke the release so taking it out |
@francinelucca, is this even with the changes listed in #6952 (comment)? |
🟢 ci completed with status |
still seeing errors even when pulling in those changes https://github.com/github/github-ui/actions/runs/18450776886/job/52564004666?pr=4409 |
Reverts #6516