material icon indicating copy to clipboard operation
material copied to clipboard

md-icon / md-list : secondary action cannot be hidden or disabled

Open pl-j opened this issue 11 years ago • 6 comments

jsFiddle : https://jsfiddle.net/xwn6dgyv/2/ NB : I'm not sure the link declared in the CSS for the icon font is permanent ; in case the icons do not appear, open [https://fonts.googleapis.com/icon?family=Material+Icons] and paste the content in the CSS zone. I did not manage to import the fonts using the jsFiddle external resources manager.

I might have missed something, but I cannot seem to properly disable the secondary action inside a list. The jsFiddle is based on the demo for the list component, so it should look familiar.

I need to display (and enable) the secondary action iff some external criteria is true. But the best I can do is to hide the icon - the blank which replaces it remains clickable.

ng-if and ng-show give the same result. Wrapping the icon inside a button and moving ng-if or ng-show to button level does even less.

pl-j avatar Oct 21 '15 16:10 pl-j

I have encountered this same bug. An ng-if="false" on an icon with md-secondary is still clickable even though it is invisible. The console also warns that the aria-label is missing for a button with class "md-secondary-container ..." which must be something that md-angular creates around the md-icon, but doesn't remove from the dom when the icon's ng-if is false.

focomoso avatar Oct 21 '15 17:10 focomoso

Note that the bug persists even when you wrap the md-secondary icon with a div with ng-if="false". I don't see any workaround.

focomoso avatar Oct 22 '15 16:10 focomoso

Also ran into this issue now.

norkunas avatar Oct 23 '15 07:10 norkunas

+1

dohomi avatar Oct 27 '15 11:10 dohomi

+1

mpukk avatar Nov 01 '15 19:11 mpukk

+1

gligoran avatar Nov 29 '15 10:11 gligoran