-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(cdk-experimental/menu): add support for inline menus #20143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,13 @@ export class MenuStack { | |
} | ||
|
||
/** Get the top most element on the stack. */ | ||
peek() { | ||
peek(): MenuStackItem | undefined { | ||
return this._elements[this._elements.length - 1]; | ||
} | ||
} | ||
|
||
/** NoopMenuStack is a placeholder MenuStack used for inline menus. */ | ||
export class NoopMenuStack extends MenuStack { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TypeScript lets you do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems to work only if all members are public. With private and protected it won't allow it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, right, you can use TypeScript |
||
/** Noop push - does not add elements to the MenuStack. */ | ||
push(_: MenuStackItem) {} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify -- does 'inline' mean it's triggered by some means other than a bar? (Such as a button?) I'd make this clearer in the documentation somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline menus aren't triggered open at all - they're always open. Think of the list of mailboxes on gmail (inbox, starred, snoozed, ...).