bokmann/font-awesome-rails

fontawesome icons change on click when using with ckeditor-rails

Closed this issue · 1 comments

I am using fontawesome (4.4) in rails (4.2.3) (via the font-awesome-rails gem).

Upon clicking on any of the fontawesome icons in my rails app, the icon changes to an angle-right (and on repeated clicking, it toggles between angle-right and angle-down). I am not doing anything in my code or css to cause that change.

Update 1: I believe ckeditor-rails includes a version of fontawesome. Removing ckeditor-rails fixes the problem. How do I resolve the conflict? - see italicized lines below for more details

For example, if I have:

<%= link_to fa_icon 'fa-envelope lg', email_path %>

The initial html is:

<i class="fa fa-envelope fa-lg"></i>

After clicking once, it becomes:

<i class="fa fa-envelope fa-lg fa-angle-right"></i>

Clicking again makes it

<i class="fa fa-envelope fa-lg fa-angle-down"></i>

Clicking repeatedly beyond that toggles between angle-right and angle-down.

I have the following relevant gems (from Gemfile.lock):

bootstrap-sass (3.3.5.1)
font-awesome-rails (4.4.0.0)
rails (4.2.3)
sass (3.4.17)
sass-rails (5.0.3)
sprockets (3.3.3)
sprockets-rails (2.3.2)

ckeditor_rails (4.5.2)

Here is my full Gemfile.lock

Contributing guidelines checklist:

  1. ran bundle update and restarted server - DONE
  2. icon exists, since it does display before clicking the first time
  3. public/assets doesn't exist
  4. emptied cache
  5. touched application.scss
  6. Happens in dev and production
  7. Making sure that no other gem dependencies include outdated versions of the FontAwesome fonts. - I don't have bootswatch, which supposedly bundles an older version of fontawesome. I also have ckeditor-rails that bundles fontawesome for its toolbar. Removing it fixes the issue. How do I debug/workaround this issue?
  8. I use fa_icon everywhere
  9. results of bundle list here
rmm5t commented

This has nothing to do with font-awesome-rails.

You've got a snippet of javascript somewhere that's triggering this behavior. This is outside the scope of what a GitHub issue is meant for.