Skip to content

Commit 7869efd

Browse files
committed
fixup! fix(cdk-experimental/menu) make trigger items behave like normal items when pressing left/right
1 parent 8fa0939 commit 7869efd

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/cdk-experimental/menu/menu-bar.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ import {PointerFocusTracker} from './pointer-focus-tracker';
2626
import {MENU_AIM, MenuAim} from './menu-aim';
2727
import {CdkMenuBase} from './menu-base';
2828

29-
// TODO(mmalerba): Keyboard controls should match
30-
// https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-1/menubar-1.html#
31-
3229
/**
3330
* Directive applied to an element which configures it as a MenuBar by setting the appropriate
3431
* role, aria attributes, and accessible keyboard and mouse handling logic. The component that

src/cdk-experimental/menu/menu.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ import {MENU_AIM, MenuAim} from './menu-aim';
3939
import {MENU_TRIGGER, MenuTrigger} from './menu-trigger';
4040
import {CdkMenuBase} from './menu-base';
4141

42-
// TODO(mmalerba): Keyboard controls should match
43-
// https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-1/menubar-1.html#
44-
4542
/**
4643
* Directive which configures the element as a Menu which should contain child elements marked as
4744
* CdkMenuItem or CdkMenuGroup. Sets the appropriate role and aria-attributes for a menu and
@@ -68,10 +65,9 @@ import {CdkMenuBase} from './menu-base';
6865
})
6966
export class CdkMenu extends CdkMenuBase implements AfterContentInit, OnDestroy {
7067
/** Event emitted when the menu is closed. */
71-
@Output() readonly closed: EventEmitter<void | 'click' | 'tab' | 'escape'> = new EventEmitter();
68+
@Output() readonly closed: EventEmitter<void> = new EventEmitter();
7269

7370
/** List of nested CdkMenuGroup elements */
74-
// TODO(mmalerba): Does it make sense for menubars to have groups as well?
7571
@ContentChildren(CdkMenuGroup, {descendants: true})
7672
private readonly _nestedGroups: QueryList<CdkMenuGroup>;
7773

@@ -84,8 +80,6 @@ export class CdkMenu extends CdkMenuBase implements AfterContentInit, OnDestroy
8480
@Optional() dir?: Directionality,
8581
) {
8682
super(elementRef, menuStack, dir);
87-
// TODO(mmalerba): This is matching what we were already doing, but judging
88-
// by the signature of `closed`, it looks like maybe we want to emit a reason?
8983
this.destroyed.subscribe(this.closed);
9084
this.menuStack?.push(this);
9185
this._parentTrigger?.registerChildMenu(this);

0 commit comments

Comments
 (0)