Skip to content

Commit ef879dc

Browse files
committed
fix(material/chips): remove tabindex
remove tabindex fixes b/286286473
1 parent dcc8442 commit ef879dc

File tree

4 files changed

+0
-23
lines changed

4 files changed

+0
-23
lines changed

src/material/chips/chip-option.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<span class="mdc-evolution-chip__cell mdc-evolution-chip__cell--primary">
44
<button
55
matChipAction
6-
[tabIndex]="tabIndex"
76
[_allowFocusWhenDisabled]="true"
87
[attr.aria-selected]="ariaSelected"
98
[attr.aria-label]="ariaLabel"

src/material/chips/chip-row.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
<span class="mdc-evolution-chip__cell mdc-evolution-chip__cell--primary" role="gridcell"
66
matChipAction
7-
[tabIndex]="tabIndex"
87
[disabled]="disabled"
98
[attr.aria-label]="ariaLabel"
109
[attr.aria-describedby]="_ariaDescriptionId">

src/material/chips/chip-row.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ export class MatChipRow extends MatChip implements AfterViewInit {
125125
_document,
126126
animationMode,
127127
globalRippleOptions,
128-
tabIndex,
129128
);
130129

131130
this.role = 'row';

src/material/chips/chip.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
afterNextRender,
3737
booleanAttribute,
3838
inject,
39-
numberAttribute,
4039
} from '@angular/core';
4140
import {
4241
MAT_RIPPLE_GLOBAL_OPTIONS,
@@ -85,7 +84,6 @@ export interface MatChipEvent {
8584
'[class._mat-animation-noopable]': '_animationsDisabled',
8685
'[id]': 'id',
8786
'[attr.role]': 'role',
88-
'[attr.tabindex]': '_getTabIndex()',
8987
'[attr.aria-label]': 'ariaLabel',
9088
'[attr.aria-hidden]': 'true',
9189
'(keydown)': '_handleKeydown($event)',
@@ -202,12 +200,6 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck
202200
@Input({transform: booleanAttribute})
203201
disabled: boolean = false;
204202

205-
/** Tab index of the chip. */
206-
@Input({
207-
transform: (value: unknown) => (value == null ? undefined : numberAttribute(value)),
208-
})
209-
tabIndex: number = -1;
210-
211203
/** Emitted when a chip is to be removed. */
212204
@Output() readonly removed: EventEmitter<MatChipEvent> = new EventEmitter<MatChipEvent>();
213205

@@ -259,13 +251,9 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck
259251
@Optional()
260252
@Inject(MAT_RIPPLE_GLOBAL_OPTIONS)
261253
private _globalRippleOptions?: RippleGlobalOptions,
262-
@Attribute('tabindex') tabIndex?: string,
263254
) {
264255
this._document = _document;
265256
this._animationsDisabled = animationMode === 'NoopAnimations';
266-
if (tabIndex != null) {
267-
this.tabIndex = parseInt(tabIndex) ?? -1;
268-
}
269257
this._monitorFocus();
270258

271259
this._rippleLoader?.configureRipple(this._elementRef.nativeElement, {
@@ -397,14 +385,6 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck
397385
// Empty here, but is overwritten in child classes.
398386
}
399387

400-
/** Gets the tabindex of the chip. */
401-
_getTabIndex() {
402-
if (!this.role) {
403-
return null;
404-
}
405-
return this.disabled ? -1 : this.tabIndex;
406-
}
407-
408388
/** Starts the focus monitoring process on the chip. */
409389
private _monitorFocus() {
410390
this._focusMonitor.monitor(this._elementRef, true).subscribe(origin => {

0 commit comments

Comments
 (0)