ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

button-icon-only class incorrectly added to button that contains data binding

Open sdsanders opened this issue 10 years ago • 2 comments

Short description of the problem:

Buttons that have data binding inside of them ({{'data'}}) and an icon incorrectly get the button-icon-only class.

Steps to reproduce:

<button round outline small>
    <ion-icon name="call-outline"></ion-icon>
    {{'testing'}}
</button>

Results in the following rendered html:

<button outline="" round="" small="" class="disable-hover button button-outline button-round button-small button-icon-only" ng-reflect-small="" ng-reflect-outline="" ng-reflect-round=""><span class="button-inner">
          <ion-icon name="call-outline" role="img" class="ion-ios-call-outline" aria-label="call outline" ng-reflect-name="call-outline"></ion-icon>
          testing
        </span><ion-button-effect></ion-button-effect></button>

Notice the button-icon-only class that should not be there.

Which Ionic Version? 1.x or 2.x Ionic 2.0.0 beta 9

Plunker that shows an example of your issue

http://plnkr.co/edit/jaMbkDfqCurh9TiNAX1E?p=preview

sdsanders avatar Jun 19 '16 16:06 sdsanders

@sdsanders thanks for submitting the issue!

@adamdbradley @jgw96 confirmed this is an issue. I think we should refactor the Button class to have a more "angularish" approach by using @ContentChildren etc. right now, if we add/remove icons/text dynamically, some classes are incorrect.

manucorporat avatar Jun 19 '16 16:06 manucorporat

This is not longer an issue since you have to specify manually when a button is "icon-only"

<button ion-button icon-only>
</button>

manucorporat avatar Sep 28 '16 19:09 manucorporat