FontAwesomePHP icon indicating copy to clipboard operation
FontAwesomePHP copied to clipboard

Class problem when same icon is used multiple times on the same page

Open ghost opened this issue 7 years ago • 3 comments

Hi,

I think there is a problem when a same icon is used multiple times on the same page.

If I use this code : {!! FA::icon('times') !!} {!! FA::icon('times') !!} {!! FA::icon('times') !!} {!! FA::icon('times') !!}

The first cross will be correctly displayed, but not the three others : Cross not correctly displayed

The bug is linked to a problem in the source code : the "fas" class is missing in the three last crosses : <i class="fas fa-times"></i> <i class=" fa-times"></i> <i class=" fa-times"></i> <i class=" fa-times"></i>

Source code with fas missing

And when is add the "fas" class manually in my Chrome, of course, it works.

Is this problem already known ? How can we fix this ?

Thanks !

ghost avatar Jul 05 '18 09:07 ghost

I don't have time to work on this, but after a quick glance through the code, I think it might be as easy as changing this line to $this->style = 'fas';

Could you see if that works? And if it does, can you open a pull request to fix it for me?

kevinkhill avatar Jul 20 '18 13:07 kevinkhill

This is fixed now, ya?

kevinkhill avatar May 04 '19 13:05 kevinkhill

Hi, The issue does not look like to be fixed. It does the same thing for me and I'm not even using the same icons: <i class="fas fa-code"></i> <i class=" fa-user"></i> Regards, Andras

gammaire avatar Apr 13 '21 14:04 gammaire