I want to use a standard icon as button in my application but it is not allowed in lightning:buttonIcon
.
If I use lightning:icon
, it does not contain onclick
handlers.
If I enclose it in div or any other html tag, I can't use event.getSource()
/event.taget/event.currentTarget
or any other event handler methods to get attribute value (like 'v.value'
) from that element because of locker service restrictions.
Why are other types not allowed in lightning:buttonIcon?
How to use standard icons in lightning:buttonIcon?
lightning component 'buttonIcon' only support "utility" icons
which answers your first question. Second question doesn't seems to be possible with lightning at the moment.