diff --git a/src/material/chips/chip-option.html b/src/material/chips/chip-option.html index 2cc3e47065bf..649509ec52b6 100644 --- a/src/material/chips/chip-option.html +++ b/src/material/chips/chip-option.html @@ -3,7 +3,6 @@ diff --git a/src/material/chips/chip-row.ts b/src/material/chips/chip-row.ts index bee7f55e087d..992e2d351b2c 100644 --- a/src/material/chips/chip-row.ts +++ b/src/material/chips/chip-row.ts @@ -125,7 +125,6 @@ export class MatChipRow extends MatChip implements AfterViewInit { _document, animationMode, globalRippleOptions, - tabIndex, ); this.role = 'row'; diff --git a/src/material/chips/chip.ts b/src/material/chips/chip.ts index 21b7308b375e..d489f9766168 100644 --- a/src/material/chips/chip.ts +++ b/src/material/chips/chip.ts @@ -13,7 +13,6 @@ import { ANIMATION_MODULE_TYPE, AfterContentInit, AfterViewInit, - Attribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, @@ -36,7 +35,6 @@ import { afterNextRender, booleanAttribute, inject, - numberAttribute, } from '@angular/core'; import { MAT_RIPPLE_GLOBAL_OPTIONS, @@ -85,7 +83,6 @@ export interface MatChipEvent { '[class._mat-animation-noopable]': '_animationsDisabled', '[id]': 'id', '[attr.role]': 'role', - '[attr.tabindex]': '_getTabIndex()', '[attr.aria-label]': 'ariaLabel', '(keydown)': '_handleKeydown($event)', }, @@ -201,12 +198,6 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck @Input({transform: booleanAttribute}) disabled: boolean = false; - /** Tab index of the chip. */ - @Input({ - transform: (value: unknown) => (value == null ? undefined : numberAttribute(value)), - }) - tabIndex: number = -1; - /** Emitted when a chip is to be removed. */ @Output() readonly removed: EventEmitter = new EventEmitter(); @@ -258,13 +249,9 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck @Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS) private _globalRippleOptions?: RippleGlobalOptions, - @Attribute('tabindex') tabIndex?: string, ) { this._document = _document; this._animationsDisabled = animationMode === 'NoopAnimations'; - if (tabIndex != null) { - this.tabIndex = parseInt(tabIndex) ?? -1; - } this._monitorFocus(); this._rippleLoader?.configureRipple(this._elementRef.nativeElement, { @@ -396,14 +383,6 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck // Empty here, but is overwritten in child classes. } - /** Gets the tabindex of the chip. */ - _getTabIndex() { - if (!this.role) { - return null; - } - return this.disabled ? -1 : this.tabIndex; - } - /** Starts the focus monitoring process on the chip. */ private _monitorFocus() { this._focusMonitor.monitor(this._elementRef, true).subscribe(origin => { diff --git a/tools/public_api_guard/material/chips.md b/tools/public_api_guard/material/chips.md index 3eb9bba7f2cb..7a387fa1dcfa 100644 --- a/tools/public_api_guard/material/chips.md +++ b/tools/public_api_guard/material/chips.md @@ -55,7 +55,7 @@ export const MAT_CHIPS_DEFAULT_OPTIONS: InjectionToken; // @public export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck, OnDestroy { - constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, _ngZone: NgZone, _focusMonitor: FocusMonitor, _document: any, animationMode?: string, _globalRippleOptions?: RippleGlobalOptions | undefined, tabIndex?: string); + constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, _ngZone: NgZone, _focusMonitor: FocusMonitor, _document: any, animationMode?: string, _globalRippleOptions?: RippleGlobalOptions | undefined); protected _allLeadingIcons: QueryList; protected _allRemoveIcons: QueryList; protected _allTrailingIcons: QueryList; @@ -77,7 +77,6 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck focus(): void; _getActions(): MatChipAction[]; _getSourceAction(target: Node): MatChipAction | undefined; - _getTabIndex(): number | null; _handleKeydown(event: KeyboardEvent): void; _handlePrimaryActionInteraction(): void; // (undocumented) @@ -99,8 +98,6 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck // (undocumented) static ngAcceptInputType_removable: unknown; // (undocumented) - static ngAcceptInputType_tabIndex: unknown; - // (undocumented) ngAfterContentInit(): void; // (undocumented) ngAfterViewInit(): void; @@ -124,16 +121,15 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck set ripple(v: MatRipple); _rippleLoader: MatRippleLoader; role: string | null; - tabIndex: number; trailingIcon: MatChipTrailingIcon; get value(): any; set value(value: any); // (undocumented) protected _value: any; // (undocumented) - static ɵcmp: i0.ɵɵComponentDeclaration; + static ɵcmp: i0.ɵɵComponentDeclaration; // (undocumented) - static ɵfac: i0.ɵɵFactoryDeclaration; + static ɵfac: i0.ɵɵFactoryDeclaration; } // @public