Should support x-offset and y-offset.
It would be nice to have another option to use md-menu as context menu. This would require an absolut positioning or?
@kara is there an ETA on this feature yet?
@kara
The following approach works by implementing in menu-trigger.ts file using x-offset only -
@Input() xOffset: string;
and in _getPosition() method add the following code snippet
return this._overlay.position()
.connectedTo(this._element,
{originX: posX, originY: originY}, {overlayX: posX, overlayY: overlayY})
.withFallbackPosition(
{originX: fallbackX, originY: originY},
{overlayX: fallbackX, overlayY: overlayY})
.withFallbackPosition(
{originX: posX, originY: fallbackOriginY},
{overlayX: posX, overlayY: fallbackOverlayY})
.withFallbackPosition(
{originX: fallbackX, originY: fallbackOriginY},
{overlayX: fallbackX, overlayY: fallbackOverlayY})
.withOffsetX(xOffset);
In HTML we can pass the x-offset as
<md-toolbar>
<button md-icon-button xOffset="20" [mdMenuTriggerFor]="posYMenu"
aria-label="Open y-positioned menu">
<md-icon>more_vert</md-icon>
</button>
</md-toolbar>
The error handling associated with the input fields can be handled in menu-errors.ts.
Please let me know if the approach is right so that I can start work on this feature including the y-offset and update the necessary test cases.
@kara @jelbourn Please review the PR and let me know your inputs on this.
Thanks
Can anyone tell me how i can do offset of menu items now? i need display menu items between button but i cant.
When y-offset will be provided?
Any updates here?
Not to be redundant but certainly hope this is being considered!
Most helpful comment
Any updates here?