-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(menu): add custom position support to menu #893
Conversation
@@ -22,10 +24,21 @@ import { | |||
}) | |||
export class MdMenu { | |||
private _showClickCatcher: boolean = false; | |||
private _classList: Object; | |||
positionX: 'before' | 'after' = 'after'; | |||
positionY: 'above' | 'below' = 'below'; |
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.
Create a type
for these, i.e.,
export type MenuPositionX: 'before' | 'after';
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.
Good call! Way better.
6ca221e
to
0829631
Compare
page = new MenuPage(); | ||
}); | ||
|
||
it('should open menu when the trigger is clicked', function () { |
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.
() =>
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.
Oh, whoa. Updated!
@@ -22,10 +26,34 @@ import { | |||
}) | |||
export class MdMenu { | |||
private _showClickCatcher: boolean = false; | |||
private _classList: Object; |
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.
Object
isn't super clear; add a comment explaining that this is the input into ngClass
with an example?
LGTM aside from existing comments; did you figure out the scrollbars on SauceLabs thing? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
r: @jelbourn
This PR adds custom position support to menu. The default menu opens "after" and "below" the trigger. If you want to change that, you can modify the "x-position" and "y-position" attributes (see design doc here).
x-position: 'before' | 'after'
y-position: 'above' | 'below'
Examples:
FYI, this PR needs to wait until my other menu PR goes in, so check out the last commit.