material icon indicating copy to clipboard operation
material copied to clipboard

md-button defined in md-menu-content is focused even it's not hovered.

Open jiangwei1221 opened this issue 10 years ago • 4 comments

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

jiangwei1221 avatar Feb 09 '16 23:02 jiangwei1221

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.

henrymana avatar Feb 13 '16 19:02 henrymana

@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

devversion avatar Feb 13 '16 22:02 devversion

+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;
   }

cmacdonnacha avatar Mar 04 '16 13:03 cmacdonnacha

This issue is closed as part of our deprecation effort. For details, see our post Spring Cleaning 2016.

ThomasBurleson avatar Apr 28 '16 19:04 ThomasBurleson