Raw HTML fragments in autocomplete

Created on 23 August 2023, over 1 year ago
Updated 12 September 2023, over 1 year ago

Problem/Motivation

After updating from 8.x-2.25 to 8.x-2.26, the autocomplete drop-down contains entries that are fragments of HTML.

Steps to reproduce

  1. Install and configure FontAwesome 8.x-2.26 (e.g. SVG with JS, and CDN for 5.12.0, 5.4.0 or 6.4.2)
  2. Add FontAwesome icon to CKEditor (4) toolbar.
  3. Create / edit a node
  4. Click FontAwesome icon on the CKEditor toolbar
  5. Start typing (e.g. "file").

Results in 8.x-2.25:

Results in 8.x-2.26:

🐛 Bug report
Status

Active

Version

2.26

Component

Code

Created by

🇬🇧United Kingdom robbm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @robbm
  • Status changed to Postponed: needs info over 1 year ago
  • 🇺🇸United States daniel.moberly

    Can you upgrade to the dev version and see if this issue persists?

  • Status changed to Active over 1 year ago
  • 🇬🇧United Kingdom robbm

    Yes, it's still there with the dev version, unfortunately. (Have also upgraded to D10, but that's made no difference either.)

  • 🇺🇸United States daniel.moberly

    Hmm, I'm not able to reproduce this at all. You've flushed caches, etc. I assume?

  • 🇬🇧United Kingdom robbm

    Yes, flushed all caches. (I've also tried different themes, just in case. But still experience the issue.)

    Inspecting the document, I see lines such as the following…

    <li class="ui-menu-item- ui-menu-item">
      <a>
        <div class="ui-autocomplete-fields ">
          <div class="ui-autocomplete-field-0">
            <i class="fa-solid fa-<span class=" ui-autocomplete-field-term">file fa-fw fa-2x"></i>
            <i class="fa-regular fa-<span class=" ui-autocomplete-field-term>file fa-fw fa-2x"></i>
            <i class="fa-sharp fa-solid fa-<span class=" ui-autocomplete-field-term">file fa-fw fa-2x"></i>
            <i class="fa-sharp fa-regular fa-<span class=" ui-autocomplete-field-term">file fa-fw fa-2x"></i>
            <span class="ui-autocomplete-field-term">file</span>
          </div>
        </div>
      </a>
    </li>
    

    So it looks like the spans are being inserted erroneously.

    We updated search_autocomplete (from 2.0.2 to 3.0.0) at the same time, and other autocompletions still seem to work fine. But perhaps it's that…

  • 🇺🇸United States alexi721

    After upgrading from D9.5.10 to D10.1.2 and to Fontawesome 8.x-2.26 I get the exact same errors as RobbM including the first half of the inserted tags.

    Also get the following Javascript error:

    fontawesome.min.js?v=6.4.2:6 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': 'ui-autocomplete-field-term"' is not a valid attribute name.
        at https://sfhsa-d10.ddev.site/libraries/fontawesome/js/fontawesome.min.js?v=6.4.2:6:37822
        at Array.forEach (<anonymous>)
        at a (https://sfhsa-d10.ddev.site/libraries/fontawesome/js/fontawesome.min.js?v=6.4.2:6:37800)
        at https://sfhsa-d10.ddev.site/libraries/fontawesome/js/fontawesome.min.js?v=6.4.2:6:37926
        at Array.forEach (<anonymous>)
        at replace (https://sfhsa-d10.ddev.site/libraries/fontawesome/js/fontawesome.min.js?v=6.4.2:6:37553)
        at Array.map (<anonymous>)
        at https://sfhsa-d10.ddev.site/libraries/fontawesome/js/fontawesome.min.js?v=6.4.2:6:38841
    

    Interestingly, when I enter 'files' all the icons listed when entered just 'file' suddenly appear.

Production build 0.71.5 2024