Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

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

Closed
pl-j opened this issue Oct 21, 2015 · 6 comments
Closed

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

pl-j opened this issue Oct 21, 2015 · 6 comments
Assignees
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Milestone

Comments

@pl-j
Copy link

pl-j commented Oct 21, 2015

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.

@focomoso
Copy link

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
Copy link

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.

@norkunas
Copy link
Contributor

Also ran into this issue now.

@dohomi
Copy link

dohomi commented Oct 27, 2015

+1

@mpukk
Copy link

mpukk commented Nov 1, 2015

+1

@gligoran
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants