Skip to content

Commit 363945b

Browse files
committed
feat(cdk/a11y): implement activate item
1 parent d563670 commit 363945b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/cdk/a11y/key-manager/tree-key-manager.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,9 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
248248
this._activeItem = activeItem == null ? null : activeItem;
249249
this._activeItemIndex = index;
250250

251-
if (!this._activeItem) {
252-
return;
253-
}
254-
this._activeItem.focus();
251+
this._activeItem?.focus();
255252
if (this._activationFollowsFocus) {
256-
this._activeItem.activate();
253+
this._activateCurrentItem();
257254
}
258255
});
259256
}
@@ -295,7 +292,9 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
295292
/** For all items that are the same level as the current item, we expand those items. */
296293
private _expandAllItemsAtCurrentItemLevel() {}
297294

298-
private _activateCurrentItem() {}
295+
private _activateCurrentItem() {
296+
this._activeItem?.activate();
297+
}
299298
}
300299

301300
// tslint:enable

0 commit comments

Comments
 (0)