Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class attribute doesn't work as expected #85

Open
AvremelM opened this issue Dec 4, 2018 · 3 comments
Open

class attribute doesn't work as expected #85

AvremelM opened this issue Dec 4, 2018 · 3 comments

Comments

@AvremelM
Copy link

AvremelM commented Dec 4, 2018

There are some issues with specifying (or not specifying) a class attribute on an {{fa-icon}} component. (This usage is demonstrated in the README, and is presumably supported, since it kinda works).

For example:

{{fa-icon "map"}}
{{fa-icon "map" class=""}}
{{fa-icon "map" class="grey"}}

results in

<svg ... class="svg-inline--fa fa-map fa-w-18  undefined ember-view"></svg>
<svg ... class="svg-inline--fa fa-map fa-w-18   ember-view"></svg>
<svg ... class="grey svg-inline--fa fa-map fa-w-18 grey grey ember-view"></svg>

This is with default setup in version 0.1.9

@robclancy
Copy link
Contributor

I don't even get "undefined" with what I just did, I get an error calling split on undefined. It's because of the way they workout the class names.

Fails
<FaIcon @icon={{icon}} @class="{{unless badge (concat 'u-c-' color '5'}}" />

Works
<FaIcon @icon={{icon}} @class="{{unless badge (concat 'u-c-' color '5') ''}}" />

@sarus
Copy link

sarus commented Jul 9, 2019

Ran into this issue as well:

Fails with split on undefined error:

           {{fa-icon "circle"
                     class=iconClass
                     fixedWidth=true}}

Works:

           {{fa-icon "circle"
                     class=(concat iconClass "")
                     fixedWidth=true}}

@acorncom
Copy link

Likely fixed by #120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants