Skip to content

[mat-menu]: control the arrow position in a nested menu trigger #8402

@shlomiassaf

Description

@shlomiassaf

Bug, feature request, or proposal: feature

What is the expected behavior?

Developer can define the location of the arrow in a nested menu submenu trigger.

What is the current behavior?

Icon is fixed to left (or right in dir=rtl) and does not take into account to nested menu positioning.

What is the use-case or motivation for changing an existing behavior?

When a menu is close to the edge of the viewport, all nested menus will position on the opposite side. A menu on the top right, in LTR direction with a nested menu will create an arrow on the submenu trigger that is on the opposite side of the position of the submenu:

image

Making the menu RTL makes it worse.

The optional locations should be one of:

  • left
  • right
  • auto

Where left and right are fixed.

auto will instruct the menu (or trigger) to calculate the position (left/right) based on where the submenu will open.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular 5.0.1, material rc0

With the current implementation, this can be achieved with css classes.
It will also require extra padding based on the result (left/right), currently the extra padding is always right (or left in RTL)

@jelbourn If this feature is approved, and if possible, i'd like to implement if/once API is agreed upon.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions