Skip to content

Commit

Permalink
Revert "fix(checkbox): redirect focus to underlying input element" (a…
Browse files Browse the repository at this point in the history
…ngular#14469)

* Revert "Revert "fix(radio): host element unable to receive focus events" (angular#14468)"

This reverts commit 4aa47c7.

* Revert "Revert "fix(a11y): activeItem out of date if active index is removed from ListKeyManager" (angular#14467)"

This reverts commit 8f790f5.

* Revert "build: update sauce connect (angular#14422)"

This reverts commit bc563b7.

* Revert "build: changelog script not filtering duplicate entries (angular#14421)"

This reverts commit fe46290.

* Revert "build: update to angular 7.1.2 (angular#14418)"

This reverts commit e1487df.

* Revert "refactor(drag-drop): move logic out of directives (angular#14350)"

This reverts commit 19f9bca.

* Revert "fix(checkbox): redirect focus to underlying input element (angular#13959)"

This reverts commit e0eb3df.
  • Loading branch information
mmalerba authored and josephperrott committed Jan 14, 2019
1 parent 484c770 commit ff40cc6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/lib/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;

cursor: pointer;
-webkit-tap-highlight-color: transparent;
outline: 0;

.mat-ripple-element:not(.mat-checkbox-persistent-ripple) {
opacity: 0.16;
Expand Down
11 changes: 1 addition & 10 deletions src/lib/checkbox/checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,6 @@ describe('MatCheckbox', () => {
expect(document.activeElement).toBe(inputElement);
});

it('should focus on underlying input element when the host is focused', () => {
expect(document.activeElement).not.toBe(inputElement);

checkboxNativeElement.focus();
fixture.detectChanges();

expect(document.activeElement).toBe(inputElement);
});

it('should forward the value to input element', () => {
testComponent.checkboxValue = 'basic_checkbox';
fixture.detectChanges();
Expand Down Expand Up @@ -799,7 +790,7 @@ describe('MatCheckbox', () => {
fixture.detectChanges();

const checkbox = fixture.debugElement.query(By.directive(MatCheckbox)).nativeElement;
expect(checkbox.getAttribute('tabindex')).toBe('-1');
expect(checkbox.getAttribute('tabindex')).toBeFalsy();
});
});

Expand Down
3 changes: 1 addition & 2 deletions src/lib/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,12 @@ export const _MatCheckboxMixinBase:
host: {
'class': 'mat-checkbox',
'[id]': 'id',
'[attr.tabindex]': '-1', // Reset back to -1 so that the `focus` event still works.
'[attr.tabindex]': 'null',
'[class.mat-checkbox-indeterminate]': 'indeterminate',
'[class.mat-checkbox-checked]': 'checked',
'[class.mat-checkbox-disabled]': 'disabled',
'[class.mat-checkbox-label-before]': 'labelPosition == "before"',
'[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,
'(focus)': '_inputElement.nativeElement.focus()',
},
providers: [MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR],
inputs: ['disableRipple', 'color', 'tabIndex'],
Expand Down

0 comments on commit ff40cc6

Please sign in to comment.