Skip to content

Commit 45c27c2

Browse files
authored
Revert "fix(radio): host element unable to receive focus events (#13956)"
This reverts commit 41eb27e.
1 parent f94fc92 commit 45c27c2

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/lib/radio/radio.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ $mat-radio-ripple-radius: 20px;
1010
.mat-radio-button {
1111
display: inline-block;
1212
-webkit-tap-highlight-color: transparent;
13-
outline: 0;
1413
}
1514

1615
// Inner label container, wrapping entire element.
@@ -142,7 +141,7 @@ $mat-radio-ripple-radius: 20px;
142141
opacity: 0.04;
143142
}
144143

145-
.mat-radio-button:not(.mat-radio-disabled).cdk-focused & {
144+
.mat-radio-button.cdk-focused & {
146145
opacity: 0.12;
147146
}
148147

src/lib/radio/radio.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ describe('MatRadio', () => {
723723
const radioButtonEl =
724724
predefinedFixture.debugElement.query(By.css('.mat-radio-button')).nativeElement;
725725

726-
expect(radioButtonEl.getAttribute('tabindex')).toBe('-1');
726+
expect(radioButtonEl.getAttribute('tabindex')).toBeFalsy();
727727
});
728728

729729
});

src/lib/radio/radio.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ export const _MatRadioButtonMixinBase:
336336
'[class.mat-radio-checked]': 'checked',
337337
'[class.mat-radio-disabled]': 'disabled',
338338
'[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"',
339-
// Needs to be -1 so the `focus` event still fires.
340-
'[attr.tabindex]': '-1',
339+
'[attr.tabindex]': 'null',
341340
'[attr.id]': 'id',
342341
// Note: under normal conditions focus shouldn't land on this element, however it may be
343342
// programmatically set, for example inside of a focus trap, in this case we want to forward

0 commit comments

Comments
 (0)