material icon indicating copy to clipboard operation
material copied to clipboard

md-select + div:hover

Open rafamardegan opened this issue 11 years ago • 7 comments

Hey guys! I'm new in AngularJS and I have a issue with md-select from Angular Material. So, in this div (select-wrapper), that is displayed on mice hover, I added a md-select component. When the cursor is positioned on md-select, the div (select-wrapper) get mice hover out. I realize that another component is displayed in the last lines of my code, when I click on md-select component. How can I fix this!? Could you guys help me?

This is my code: http://codepen.io/anon/pen/OyWMdK

rafamardegan avatar Sep 29 '15 18:09 rafamardegan

:+1:

dcoferraz avatar Sep 29 '15 18:09 dcoferraz

So, you'll probably need to use a bit of JS to make this happen rather than pure CSS. I would look at using the ng-mouseenter and ng-mouseleave directives on your DIV and having those fire a method on your scope/controller that checks whether the select is open (if open, don't close the div).

You may also want to look at the docs for select, particularly the md-on-close as you may want to close your div when the select closes.

In general, this type of question is best asked/answered on the forum rather than on GitHub where we track bugs/issues.

topherfangio avatar Sep 29 '15 19:09 topherfangio

@topherfangio, could you suggest a implementation of this feature?

dcoferraz avatar Sep 30 '15 15:09 dcoferraz

@topherfangio, thank you for help me. I'm almost there using the directives that you suggest.

rafamardegan avatar Sep 30 '15 15:09 rafamardegan

@topherfangio, me and @rafamardegan ended up fixing the issue with these directives shown on this codepen.

http://codepen.io/anon/pen/ojBEEV

dcoferraz avatar Sep 30 '15 18:09 dcoferraz

@topherfangio, again... thank you!

rafamardegan avatar Sep 30 '15 19:09 rafamardegan

Keep in mind that UI treatment is totally inaccessible to keyboard and screen reader users. Perhaps you could put tabindex="0" on the wrapper and expose it on focus? Though I'm not sure what the role for that element would be, since it has a select in it. Maybe treat it like a dialog?

marcysutton avatar Sep 30 '15 19:09 marcysutton