Skip to content
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

feat(material/radio): add the ability to interact with disabled radio buttons #29490

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

crisbeto
Copy link
Member

Adds the disabledInteractive input that allows users to opt into being able to interact with a disabled radio button (e.g. focus or show a tooltip).

Also fixes that we weren't setting pointer-events: none on the entire container when it's disabled.

@crisbeto crisbeto added G This is is related to a Google internal issue target: minor This PR is targeted for the next minor release labels Jul 26, 2024
@crisbeto crisbeto requested a review from a team as a code owner July 26, 2024 09:44
@crisbeto crisbeto requested review from mmalerba and andrewseguin and removed request for a team July 26, 2024 09:44
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Jul 26, 2024
@@ -466,6 +466,19 @@ describe('MDC-based MatCheckbox', () => {
expect(inputElement.disabled).toBe(false);
}));

it('should not change the checked state if disabled and interactive', fakeAsync(() => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the radio button, but I realized that I forgot to include it in #29474.

// The real click event will bubble up, and the generated click event also tries to bubble up.
// This will lead to multiple click events.
// Preventing bubbling for the second event will solve that issue.
event.stopPropagation();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this because it turned out that before this change we were never actually calling the _onInputClick callback. It must've gotten lost during the MDC transition.

@crisbeto crisbeto requested a review from amysorto July 26, 2024 09:46
… buttons

Adds the `disabledInteractive` input that allows users to opt into being able to interact with a disabled radio button (e.g. focus or show a tooltip).

Also fixes that we weren't setting `pointer-events: none` on the entire container when it's disabled.
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jul 27, 2024
@crisbeto crisbeto merged commit 0af3b61 into angular:main Jul 27, 2024
21 of 24 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker detected: feature PR contains a feature commit G This is is related to a Google internal issue target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants