Font-Awesome icon indicating copy to clipboard operation
Font-Awesome copied to clipboard

Bug: observeMutations broken in @fortawesome/fontawesome-svg-core 1.3.0-beta2

Open lynchem opened this issue 2 years ago • 0 comments

Bug description

We've been using FA5 with svg-core 1.2.36 without any issue and today wanted to upgrade to FA6 and saw that our icons no longer update when we switch the class in the <i> elements at runtime. We're using MeteorJS v2.5.8 and Blaze

Our setup of FA is pretty straightforward.

import {library, config, dom} from "@fortawesome/fontawesome-svg-core";
import {far} from "@fortawesome/pro-regular-svg-icons";
library.add(far);
config.autoReplaceSvg = "nest";
config.keepOriginalSource = false;
config.observeMutations = true;
dom.watch({
    autoReplaceSvgRoot: document.body,
    observeMutationsRoot: document.body
});

This has worked fine until now but something introduced in 1.3.0-beta2 broke the observer. If we understood what changed maybe we can find a workaround. I've also tried with the latest 6.1.2. Same result. 1.3.0-beta2 is the first version I see this behaviour. Here's what the html looks like after we've switched the icon from fa-caret-down to fa-tree-deciduous (i updated from tree-alt in case that might have been part of the issue).

<i title="Funerals" data-fa-i2svg="" class="far fa-fw fa-lg fa-tree-deciduous"><svg class="svg-inline--fa fa-caret-down fa-fw fa-lg" aria-labelledby="svg-inline--fa-title-0at6Qn55hC2Q" data-prefix="far" data-icon="caret-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" data-fa-i2svg=""><title id="svg-inline--fa-title-0at6Qn55hC2Q">Funerals</title><path fill="currentColor" d="M271.1 176H48.08c-42.63 0-64.25 51.77-33.88 81.9l111.9 112c18.63 18.76 49.13 18.76 67.88 0l112-112C335.1 227.8 314.7 176 271.1 176zM159.1 336L47.96 224H271.1L159.1 336z"></path></svg></i>

Reproducible test case

No response

Screenshots

No response

Font Awesome version

v.6.1.2

Serving

Other (as specified in the bug description)

Implementation

Other (as specified in the bug description)

Browser and Operating System

Chrome 103 on Windows 11

Web bug report checklist

  • [ ] I have included a test case because my odds go way up that the team can fix this when I do
  • [X] I have searched for existing issues and to the best of my knowledge this is not a duplicate

lynchem avatar Jul 26 '22 17:07 lynchem