question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow styling of menu actuators

See original GitHub issue

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

When I trigger an md-menu with an actuator (usually a button) connected with md-menu-trigger-for, I want an easy way to change the appearance of the actuator for as long as the menu is open that doesn’t involve a custom component or directive.

What is the current behavior?

md-menu-trigger-for offers onMenuOpen and onMenuClose events that allow for custom behaviors but it does nothing to allow custom appearances with just template logic and CSS.

What are the steps to reproduce?

Standard button menu example:

<button md-icon-button class=“md-primary” [md-menu-trigger-for]=“myMenu”> <md-icon>create</md-icon> </button> <cfc-menu #myMenu=“cfcMenu” [menu]=“myMenuModel”></cfc-menu>

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

Many Material menu buttons I know use a “held open” appearance for the button while the menu is opened. This goes away when the menu is closed by any means (clicking on the backdrop, clicking on the button again, etc.).

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

ng2 Material 2

Is there anything else we should know?

jelbourn proposed: “I would implement it as the menu exposing an isOpen property, so you could do something like:”

<button md-menu-trigger-for=“myMenu” [class.xx-menu-open]=“myMenu.isOpen”>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jelbourncommented, Dec 15, 2016

@dansanderson Ah, I missed that property. It would be

<button md-menu-trigger-for="..." 
    #trigger="mdMenuTrigger" 
    [class.xx-open]="trigger.menuOpen">
0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Menu Styling | Web Accessibility Initiative (WAI)
Convey menu items and their states by using color and other styling options. Don't rely on color alone as some users will be...
Read more >
Menus | Android Developers
A menu group is a collection of menu items that share certain traits. With a group, you can: Show or hide all items...
Read more >
Styling Navigation Menus
To style the selected menu item, use the Style pane properties. Your changes are immediately reflected in the menu. Repeat as required for...
Read more >
Selecting the Right Actuator Controls for Your Application
With many different types and styles of actuator on the market, ... It allows for more precise positioning through the use of a...
Read more >
Lesson 2: Stylizing a Navigation Menu with CSS
Finally, to prevent side effects from all those floated elements, add clear:left to the style definition for main, since that's the content that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found