md-button defined in md-menu-content is focused even it's not hovered.
We need to put two buttons in a row in a md-menu-content. The first button always gets focused when the container row is hovered but the button itself is not hovered.
Please see this codepen example: http://codepen.io/wintokk/pen/pgQmdJ
I had the same problem earlier. It doesn't seem to be documented but looking at the md-menu code (menuServiceProvider.js activateInteraction function) there is an "md-menu-focus-target" attribute which can be used to specify the initial focus. It would be great to document this.
@jiangwei1221 @henrymana As henry already said, there is a md-menu-focus-target attribute, which should be documented. And as you can see here, the first button, which is not disabled, will be always focused on hover. I would suggest introducing a new attribute which prevents focus-hover.
@EladBezalel
+1. I also have 3 buttons inside a row which is inside md-menu-content. The first button is always focused and stays focused even when hovering over other buttons.
As per @jiangwei1221's fix in his code pen, the following is a workaround:
.md-button.md-focused:not(:hover):focus {
background-color: transparent;
}
This issue is closed as part of our deprecation effort. For details, see our post Spring Cleaning 2016.