Skip to content

Commit 52aead3

Browse files
committed
chore: also remove duplicate activedescendant
1 parent 75f12fc commit 52aead3

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

src/lib/autocomplete/autocomplete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
ChangeDetectionStrategy,
2121
} from '@angular/core';
2222
import {MdOption} from '../core';
23-
import {ActiveDescendantKeyManager} from '../core/a11y/activedescendant-key-manager';
23+
import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
2424

2525
/**
2626
* Autocomplete IDs need to be unique across components, so this counter exists outside of

src/lib/core/a11y/activedescendant-key-manager.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,4 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ListKeyManager, ListKeyManagerOption} from './list-key-manager';
10-
11-
/**
12-
* This is the interface for highlightable items (used by the ActiveDescendantKeyManager).
13-
* Each item must know how to style itself as active or inactive and whether or not it is
14-
* currently disabled.
15-
*/
16-
export interface Highlightable extends ListKeyManagerOption {
17-
setActiveStyles(): void;
18-
setInactiveStyles(): void;
19-
}
20-
21-
export class ActiveDescendantKeyManager<T> extends ListKeyManager<Highlightable & T> {
22-
23-
/**
24-
* This method sets the active item to the item at the specified index.
25-
* It also adds active styles to the newly active item and removes active
26-
* styles from the previously active item.
27-
*/
28-
setActiveItem(index: number): void {
29-
Promise.resolve().then(() => {
30-
if (this.activeItem) {
31-
this.activeItem.setInactiveStyles();
32-
}
33-
super.setActiveItem(index);
34-
if (this.activeItem) {
35-
this.activeItem.setActiveStyles();
36-
}
37-
});
38-
}
39-
40-
}
9+
export {ActiveDescendantKeyManager, Highlightable} from '@angular/cdk/a11y';

0 commit comments

Comments
 (0)