[tagify_facets] JS error when hiding amount of results (show_numbers)
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3539982. --> Reported by: [herved](https://www.drupal.org/user/2197136) Related to !163 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The tagify-widget.js breaks and a JS error is thrown when hiding amount of results (show_numbers: FALSE).</p> <pre>Uncaught TypeError: Cannot read properties of null (reading 'textContent')<br>&nbsp;&nbsp;&nbsp; at HTMLAnchorElement.&lt;anonymous&gt; (tagify-widget.js?t0kl0l:26:65)<br>&nbsp;&nbsp;&nbsp; at T.each (jquery.min.js?v=4.0.0-beta.2:2:2876)<br>&nbsp;&nbsp;&nbsp; at T.each (jquery.min.js?v=4.0.0-beta.2:2:1386)<br>&nbsp;&nbsp;&nbsp; at HTMLUListElement.&lt;anonymous&gt; (tagify-widget.js?t0kl0l:23:22)<br>&nbsp;&nbsp;&nbsp; at T.each (jquery.min.js?v=4.0.0-beta.2:2:2876)<br>&nbsp;&nbsp;&nbsp; at T.each (jquery.min.js?v=4.0.0-beta.2:2:1386)<br>&nbsp;&nbsp;&nbsp; at Drupal.facets.initTagify (tagify-widget.js?t0kl0l:16:13)<br>&nbsp;&nbsp;&nbsp; at Object.attach (tagify-widget.js?t0kl0l:180:21)<br>&nbsp;&nbsp;&nbsp; at drupal.js?v=11.2.2:166:24<br>&nbsp;&nbsp;&nbsp; at Array.forEach (&lt;anonymous&gt;)</pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>- Apply tagify on a facet<br> - Uncheck "Show the amount of results"<br> - Load the page where the facet is displayed<br> =&gt; notice the tagify element is missing/not displayed and the above JS error in console</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Fix the JS</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>TODO</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>TODO</p> <h3 id="summary-api-changes">API changes</h3> <p>TODO</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>TODO</p>
issue